Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i use MoveTo?

I've seen this in a lot of minigame scripts. I've used

script.Parent.Touched:connect(function(at)
         at:MoveTo(script.Parent.Position)
end)

but for some reason errors.. can anywone help?

1 comment

0

Btw im trying to make the at variable teleport to the other side of the map.

1 answer

✓ Accepted answer
script.Parent.Touched:connect(function(at)
	at.Parent:FindFirstChild("Humanoid"):MoveTo(script.Parent.Position)
end)

you have to find the Humanoid of the player that you want to move because MoveTo is in you players Humanoid.

if you want the player to keep on following the part for ever then

script.Parent.Touched:connect(function(at)
	while true do
    at.Parent:FindFirstChild("Humanoid"):MoveTo(script.Parent.Position)
wait()
end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.