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

Why cant I make my player moveto a cordinate?

Asked by 5 years ago
Edited 5 years ago

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
0
what exactly about it isn't working? thebayou 441 — 5y
0
Sadly all of it, When the player enters it doesn't move them at all.. 1020x802 -3 — 5y

1 answer

Log in to vote
0
Answered by
thebayou 441 Moderation Voter
5 years ago

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.

Ad

Answer this question