Pathfinding service path randomly stopping

im trying to make the monkey pathfind to the sink.

(monkeymove is where the monkey is supposed to move

script.Parent.Torso:SetNetworkOwner(nil)
local pathfind = game:GetService("PathfindingService")
local part = workspace.MonkeyMove

local human = script.Parent:WaitForChild("Humanoid")
local torso = script.Parent:WaitForChild("Torso")



	local path = pathfind:CreatePath()
	path:ComputeAsync(torso.Position, part.Position)
	local waypoints = path:GetWaypoints()


for i, waypoint in pairs(waypoints) do
	if waypoint.Action == Enum.PathWaypointAction.Jump then
		human:ChangeState(Enum.HumanoidStateType.Jumping)
	end
	human:MoveTo(waypoint.Position)
	human.MoveToFinished:Wait(2)
end



	human:MoveTo(part.Position)
1 Like