I am making a game, similar to a speedrunning game where you try to beat the record.
I was using teleporters to teleport to the other pad. Pad one, and pad two.
Here is both of the pads scripts.
local Teleport = "ToMoon"
function Touch (hit)
if script.Parent.Locked == false and script.Parent.Parent : FindFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:FindFirstChild(Teleport).Locked=true
local Pos = script.Parent.Parent:FindFirstChild(Teleport)
hit.parent:moveTo(Pos.Position) wait(2)script.Parent.Locked = false script.Parent.Parent:FindFirstChild(Teleport).Locked = false
end
end
script.Parent.Touched:connect(Touch)
The name of the one above is “ToEarth”
And the name of the one below is “ToMoon”
local Teleport = "ToEarth"
function Touch (hit)
if script.Parent.Locked == false and script.Parent.Parent : FindFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:FindFirstChild(Teleport).Locked=true
local Pos = script.Parent.Parent:FindFirstChild(Teleport)
hit.parent:moveTo(Pos.Position) wait(1)script.Parent.Locked = false script.Parent.Parent:FindFirstChild(Teleport).Locked = false
end
end
script.Parent.Touched:connect(Touch)
They work for a while, but then when you try after a while with a friend it just stops working. Please help,
Thanks.