Okay, I managed to fix my problem.
The script for those who want it:
local TeleportPart1 = script.Parent.TeleportPart1
local Part1 = script.Parent.Part1
TeleportPart1.Touched:Once(function(t)
if t.Parent:FindFirstChild("Humanoid") then
local hum = t.Parent:FindFirstChild("HumanoidRootPart")
local RelativePosition = TeleportPart1.Center.CFrame:toObjectSpace(hum.CFrame)
local NextCenterCFrame = Part1.Center.CFrame
local NewCFrame = NextCenterCFrame * RelativePosition
hum.CFrame = NewCFrame
end
script.Disabled = true
wait(1)
script.Disabled = false
end)
Center is a part placed in the middle of Part1 and TeleportPart1