Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Teleporters tping the player in a random spot?

Asked by 3 years ago

So ive been working with Teleporters and when i teleport i dont go where im supposed to go how can i fix this?

Script

local ClickDetector = script.Parent.ClickDetector
local TP = script.Parent.Parent.TP_2


ClickDetector.MouseClick:Connect(function(plr)
plr.Character:MoveTo(TP.Position)



end)

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

When I tested, I had no issues.

local ClickDetector = script.Parent.ClickDetector
local TP = script.Parent.Parent.TP_2


ClickDetector.MouseClick:Connect(function(plr)
    local Pos = TP.Position
    local character = plr.Character
    local Root = character:WaitForChild("HumanoidRootPart")
    Root.Position = Pos
end)

If you still have issues, check spelling and make sure you don't have multiple TP_2's.

Ad

Answer this question