function Pathfinder.DrawPath(Z,s)assert(s and s.Status==Enum.PathStatus.Success,"\080\097\116\104\102\105\110\100\101\114\058\068\114\097\119\080\097\116\104\040\080\097\116\104\041 \114\101\113\117\105\114\101\115 \097 \118\097\108\105\100 \080\097\116\104\033")Z:DestroyDrawnPath()local e=Z._DrawnPath or Instance.new("\077\111\100\101\108")e.Name="\080\097\116\104\102\105\110\100\101\114\095\080\097\116\104"for s,Z in pairs(s:GetWaypoints())do local W=Instance.new("\080\097\114\116")W.Name=string.format("\087\097\121\112\111\105\110\116\095\037\100",s)W.Anchored=true W.CanCollide=false W.Size=Vector3.new(1,1,1)W.CFrame=CFrame.new(Z.Position)W.BrickColor=Z.Action==Enum.PathWaypointAction.Jump and BrickColor.Blue()or BrickColor.Gray()W.Parent=e end e.Parent=workspace Z._DrawnPath=e return e end function Pathfinder.DestroyDrawnPath(s)if s._DrawnPath then s._DrawnPath:ClearAllChildren()end end
--[[
	@param 	Path		Path			The Path-object we want to visualize
	@return	Model		DrawnPath		Returns the model containing the drawn path 	
--]]
function Pathfinder:DrawPath(Path)
	assert(Path and Path.Status == Enum.PathStatus.Success, "Pathfinder:DrawPath(Path) requires a valid Path!")
	self:DestroyDrawnPath()

	-- Generate new path visuals
	local container = self._DrawnPath or Instance.new("Model")
	container.Name = "Pathfinder_Path"
	for index, waypoint in pairs(Path:GetWaypoints()) do
		local p = Instance.new("Part")
		p.Name = string.format("Waypoint_%d", index)
		p.Anchored = true
		p.CanCollide = false
		p.Size = Vector3.new(1, 1, 1)
		p.CFrame = CFrame.new(waypoint.Position)
		p.BrickColor = waypoint.Action == Enum.PathWaypointAction.Jump and BrickColor.Blue() or BrickColor.Gray()
		p.Parent = container
	end
	container.Parent = workspace
	self._DrawnPath = container
	return container
end

function Pathfinder:DestroyDrawnPath()
	if self._DrawnPath then
		self._DrawnPath:ClearAllChildren()
	end
end
