Hello there developers!
Have you ever wanted an NPC that walks to a specified location? Well then your in luck, because I made a script that will make an NPC walk to specified locations.
Here are the following steps:
-
Add a rig to your workspace.
-
Add a script inside of the rig.
-
Paste the following inside the script:
local NPC = game.Workspace.Rig -- Feel free to name the model and the parts to whatever you want! You may change the waiting time if you wish!
while true do
NPC.Humanoid:MoveTo(game.Workspace.Part.Position)
NPC.Humanoid.MoveToFinished:Wait()
wait(5)
NPC.Humanoid:MoveTo(game.Workspace.Part2.Position)
NPC.Humanoid.MoveToFinished:Wait()
wait(5)
NPC.Humanoid:MoveTo(game.Workspace.Part3.Position)
NPC.Humanoid.MoveToFinished:Wait()
wait(5)
end
It is highly recommended that you set the transparency of the parts to 1 and turn off CanColide. I hope this script helped you guys a lot! Feel free to send feedback down below!