Anyone knows how to make a loop path for npc?

I’m actually kind of stuck in this part, anyone knows how to make a infinite loop path for npc? where they just walk around again and again, i tried researching in google & youtube they only show me how they created a path. i hope yall can help me.

Sorry but I’m not a professional developer, I know only how to create path but I don’t know how to make a infinite loop maybe this should help you: Search in toolbox for a npc and then look in the code, maybe you’ll understand the code, after you know the code, in the future you will know how to code it!

Shouldn’t it just be as simple as a while true do loop .-.
Using Humanoid.MoveToFinished:Wait() you can use it on every point so the loop doesn’t go through without actually moving the humanoid

Correct, it is that simple.

local Run = game:GetService("RunService")
local Humanoid = script.Parent --Server script inside NPC's humanoid instance.

while true do
	Run.Stepped:Wait()
	Humanoid:MoveTo(Vector3.new(0, 0, 0)) --You would need to change this.
	Humanoid.MoveToFinished:Wait() --Waits for MoveToFinished RBXScriptSignal to fire (either when the destination is reached or eight seconds have elapsed).
end
1 Like