-
What do you want to achieve? I want a working teleport script that teleports you to the part its paired with, so you can teleport back and forth between them
-
What is the issue? I’m able to teleport back and forth between the tpers, but immediately after teleporting if I touch any unanchored part in a certain timeframe (im not sure why) I teleport back to the teleporter i came back from
-
What solutions have you tried so far? increasing debounce time, lowering debounce time, checking for scripts inside unanchored parts (but it seems to work for all of them
heres the script of one of the teleporters.
the teleporter its paired with has the exact same script but the Teleport variable at the top is changed.
local Teleport = "Teleport2"
script.Parent.Touched:connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
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)
task.wait(1)
script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false
end
end
end)
example video of the problem.
note: the part i touched that teleported me back was a random unanchored part i just created