How to Stop Pathfind service and create a new one

I’m controlling alot of troops at once and whend a neecomand comes i want for the troops go to the last command recived from the remoteevent the script is these

function moveTo(v,targetpoint)
	local function walktroop()
		local path = PathS:CreatePath(agentParameters)
		local Number = v.Configuration.Number
		local LHumanoid = v.Humanoid
		local LHumanoidRootPart = v.HumanoidRootPart
		local were = SetWere(v,Number)
		path:ComputeAsync(LHumanoidRootPart.Position,playerPosition*were)
		for k, waypoint in pairs(path:GetWaypoints()) do	
			LHumanoid:MoveTo(waypoint.Position)
			LHumanoid.MoveToFinished:Wait()
		end
		path:Destroy()
		--moveTo(v,pos * were)
	end
	coroutine.wrap(walktroop)()
end