So I made this thing for fun, where a NPC chases you using waypoints (Like in Doors)
But it works horrible when Im using the Humanoid:MoveTo() function
Script for the NPC’s waypoints
for i = 34,#workspace.room:GetChildren()+33,1 do
local room = workspace.room:FindFirstChild("Room"..i)
for x = 1,#room.NexuzPath:GetChildren() do
workspace.NEXUZ.Humanoid:MoveTo(room.NexuzPath:FindFirstChild(x).Position)
workspace.NEXUZ.Humanoid.MoveToFinished:Wait()
print('He finished Moving')
end
end
Script for the Part’s waypoints (Which is working perfectly)
for i = 34,#workspace.room:GetChildren()+33,1 do
local room = workspace.room:FindFirstChild("Room"..i)
for x = 1,#room.NexuzPath:GetChildren() do
workspace.baldy.CFrame = room.NexuzPath:FindFirstChild(x).CFrame
wait(1)
end
end
Here’s footage of both scripts in-game:
Script for the NPC: as you can see he moves to 1 point and then just stops. But it does print He finished moving.
Script for the Part: it follows the waypoints perfecty and like intended.
I would like to know how to fix this