local function h(h)local e={}for A,q in ipairs(h)do local E=visualWaypoint:Clone()E.Position=q.Position E.Parent=workspace E.Color=q==h[#h]and Color3.fromRGB(0,255,0)or q.Action==Enum.PathWaypointAction.Jump and Color3.fromRGB(255,0,0)or Color3.fromRGB(255,139,0)table.insert(e,E)end return e end

local function createVisualWaypoints(waypoints)
	local visualWaypoints = {}
	for _, waypoint in ipairs(waypoints) do
		local visualWaypointClone = visualWaypoint:Clone()
		visualWaypointClone.Position = waypoint.Position
		visualWaypointClone.Parent = workspace
		visualWaypointClone.Color =
			(waypoint == waypoints[#waypoints] and Color3.fromRGB(0, 255, 0))
			or (waypoint.Action == Enum.PathWaypointAction.Jump and Color3.fromRGB(255, 0, 0))
			or Color3.fromRGB(255, 139, 0)
		table.insert(visualWaypoints, visualWaypointClone)
	end
	return visualWaypoints
end
