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

How to make an npc move?

Asked by 10 years ago

Well i was just wondering So to get it to move like helperbot from welcome to roblox building

1 answer

Log in to vote
2
Answered by
JayByte 25
10 years ago

Your question isn't very detailed but I'll try my best. You can use the :MoveTo method on the NPC's humanoid.

http://wiki.roblox.com/index.php?title=MoveTo_(Method)/humanoid

You could then introduce a loop so the NPC could walk on a certain route repetitively. Super Basic Example:

humanoid = Workspace.mybot.Humanoid
part1 = Workspace.p1 -- Just a part in workspace.
part2 = Workspace.p2 -- Just a part in workspace.
part3 = Workspace.p3 -- Just a part in workspace.

while true do
    humanoid:MoveTo(part1.Position, part1)
    wait(3) -- How long it takes for him to get there?
    humanoid:MoveTo(part2.Position, part2)
    wait(3)
    humanoid:MoveTo(part3.Position, part3)
    wait(3)
end
Ad

Answer this question