function API.FindPath(h,F,Q)local q={}local z={}local o local y=false repeat o=pathfindingService:ComputeRawPathAsync(F,Q,500)table.insert(z,o)if o.Status~=Enum.PathStatus.FailStartNotEmpty and o.Status~=Enum.PathStatus.FailFinishNotEmpty then for F,Q in pairs(o:GetPointCoordinates())do table.insert(q,Q)end if o.Status==Enum.PathStatus.ClosestOutOfRange then F=q[#q]if#z>=MAX_PATHS then y=true break end end end until o.Status~=Enum.PathStatus.ClosestOutOfRange if#q>2 then q=SimplifyPointsStraight(SimplifyPointsDiagonal(q))end return CreatePathObject(z,q,y and Enum.PathStatus.ClosestOutOfRange or o.Status)end function API.SetEmptyCutoff(Q,F)pathfindingService.EmptyCutoff=F end


function API:FindPath(pointA, pointB)
	local points = {}
	local paths = {}
	local path
	local tooLong = false
	repeat
		path = pathfindingService:ComputeRawPathAsync(pointA, pointB, 500)
		table.insert(paths, path)
		if (path.Status ~= Enum.PathStatus.FailStartNotEmpty and path.Status ~= Enum.PathStatus.FailFinishNotEmpty) then
			for _,pt in pairs(path:GetPointCoordinates()) do
				table.insert(points, pt)
			end
			if (path.Status == Enum.PathStatus.ClosestOutOfRange) then
				pointA = points[#points]
				if (#paths >= MAX_PATHS) then
					tooLong = true
					break
				end
			end
		end
	until (path.Status ~= Enum.PathStatus.ClosestOutOfRange)
	if (#points > 2) then
		points = SimplifyPointsStraight(SimplifyPointsDiagonal(points))
	end
	return CreatePathObject(paths, points, (tooLong and Enum.PathStatus.ClosestOutOfRange or path.Status))
end

function API:SetEmptyCutoff(emptyCutoff)
	pathfindingService.EmptyCutoff = emptyCutoff
end
