New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to MoveTo local character?

Asked by 3 months ago

Hey there! I got an question: How to MoveTo your local character to a brick in the workspace. I mean that the local player walk to the brick in the workspace. I tried alot but it didn't work. Can anyone explain me this?

Sincerly Nathan EggService The Netherlands

1 answer

Log in to vote
0
Answered by 3 months ago
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        char:WaitForChild("Humanoid"):MoveTo(--put the brick here)
    end)
end)

This script basically waits for every character added in game, and then uses the event MoveTo for moving him to the brick you've set. MoveTo is pretty useful for NPCs and AIs, also if you didnt know, PlayerAdded fires when a player joined, and characteradded when a character was added (even with respawning), as it name says.

Hope i helped, if it works, it would be nice to get this as accepted answer ;)

Ad

Answer this question