My pathfinding script currently only lets my NPC walk to 1 waypoint. How do I make it walk to other waypoints?
-- script local playertorso = script.Parent.Torso.Position local location = workspace.location.Position local npc = script.Parent.Humanoid local path = game:GetService("PathfindingService"):FindPathAsync(playertorso,location) local points = path:GetWaypoints() if path.Status == Enum.PathStatus.Success then for i,v in pairs(points) do npc:MoveTo(v.Position) npc.MoveToFinished:Wait() if v.Action == Enum.PathWaypointAction.Jump then npc.Jump = true end end end
Help will be appreciated, thanks.