So the NPC moves smoothly to the destination once or twice but then starts to pause at each waypoint for an unknown reason, or, at least unknown to me... I asked this in the Discord server a few times, but nothing I tried from there works. What can I do to fix it?
while true do
local post = campPosts[math.random(1, #campPosts)]
path:ComputeAsync(torso.Position, post.Position)
local waypoints = path:GetWaypoints()
for i, v in pairs(waypoints) do
if v.Action == Enum.PathWaypointAction.Jump then
humanoid.Jump = true
end
humanoid:MoveTo(v.Position, post)
humanoid.MoveToFinished:Wait()
path.Blocked:Connect(function()
path:ComputeAsync(torso.Position, post.Position)
end)
end
print("lastHere")
if post.Name == "optionalPost" then
wait(5)
elseif post.Name == "importantPost" then
wait(30)
elseif post.Name == "mandatoryPost" then
break
end
end

3 comments
why do you have the break there on 22? it doesnt serve a purpose. you can put "return end" but I have no clue why you put break, thats usually only used for "for i" loops
this wont effect anything btw, i just noticed it
the return would be inside the elseif tho and I want to break the loop so it doesn't go to another post