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

Why cant I make my player moveto a cordinate?

I am new to scripting and am trying to script it so where someone joins they are forced to move right and wont stop moving, therefore i looked for scripting guides and came up with this does anyone know why it doesn't work?

while wait() do
	wait(0.1)
	game.Players.PlayerName.Character:MoveTo(Vector3.new(0.06, 1, -454.194)) -- cordinates
end

2 comments

0

what exactly about it isn't working?

0

Sadly all of it, When the player enters it doesn't move them at all..

1 answer

I have a few points I want to make:

First, you don't need 2 waits in your loop (you have one on line 1 and another one inside the loop). One's enough.

Second, you don't need a loop at all. If you just call :MoveTo(), it will automatically make the character walk to a certain point without having you to manually recall that every time.

Third, you'll need to disable player control (is it done automatically? I can't remember). Otherwise, the player'll be able to try to fight back and go somewhere else. Again, if I'm wrong and the player can't control its movement, then you can ignore this.

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