Teleport Script
Teleport Script: ``
local Teleport1A = script.Parent local Teleport1B = script.Parent.Teleport1B local canTeleport = true function Teleport1A(part) local hum = part.Parent:FindFirstChild("HumanoidRootPart") if hum then if canTeleport then canTeleport = false hum.CFrame = Teleport1B.CFrame + Vector3.new(0,5,0) wait(5) canTeleport = true end end end function Teleport1B(part) local hum = part.Parent:FindFirstChild("HumanoidRootPart") if hum then if canTeleport then canTeleport = false hum.CFrame = Teleport1A.CFrame + Vector3.new(0,5,0) wait(5) canTeleport = true end end end Teleport1A.Touched:connect(Teleport1A) Teleport1B.Touched:connect(Teleport1B) `> `
Teleport1A.Touched:connect(Teleport1A) Teleport1B.Touched:connect(Teleport1B)
>
Well, I would like you to use MoveTo
instead of Vector3. If the script doesn't work, double check the directories of the part and then also not working, try changing the name of both the functions.
local Teleport1A = script.Parent local Teleport1B = script.Parent.Teleport1B local canTeleport = true function Teleport1A(part) local hum = part.Parent if hum then if canTeleport then canTeleport = false hum:MoveTo(Teleport1B.Position) -- Moves the player's position to Teleport1B's position wait(5) canTeleport = true end end end function Teleport1B(part) local hum = part.Parent if hum then if canTeleport then canTeleport = false hum:MoveTo(Teleport1A.Position) wait(5) canTeleport = true end end end Teleport1A.Touched:Connect(Teleport1A) -- Capital 'C' Teleport1B.Touched:Connect(Teleport1B) -- Capital 'C'
Lemme know if it helps!