function Path.new(A,r,t)if not(A and(A:IsA("\077\111\100\101\108")and A.PrimaryPart))then output(error,"\080\097\116\104\102\105\110\100\105\110\103 \097\103\101\110\116 \109\117\115\116 \098\101 \097 \118\097\108\105\100 \077\111\100\101\108 \073\110\115\116\097\110\099\101 \119\105\116\104 \097 \115\101\116 \080\114\105\109\097\114\121\080\097\114\116\046")end local B=setmetatable({_settings=t or DEFAULT_SETTINGS;_events={Reached=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116"),WaypointReached=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116");Blocked=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116");Error=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116"),Stopped=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")};_agent=A,_humanoid=A:FindFirstChildOfClass("\072\117\109\097\110\111\105\100");_path=PathfindingService:CreatePath(r),_status="\073\100\108\101",_t=0,_position={_last=Vector3.new();_count=0}},Path)for A,r in pairs(DEFAULT_SETTINGS)do B._settings[A]=B._settings[A]==nil and r or B._settings[A]end B._path.Blocked:Connect(function(...)if(B._currentWaypoint<=...and B._currentWaypoint+1>=...)and B._humanoid then setJumpState(B)B._events.Blocked:Fire(B._agent,B._waypoints[...])end end)return B end
--[[ CONSTRUCTOR ]]
--
function Path.new(agent, agentParameters, override)
	if not (agent and agent:IsA("Model") and agent.PrimaryPart) then
		output(error, "Pathfinding agent must be a valid Model Instance with a set PrimaryPart.")
	end

	local self = setmetatable({
		_settings = override or DEFAULT_SETTINGS,
		_events = {
			Reached = Instance.new("BindableEvent"),
			WaypointReached = Instance.new("BindableEvent"),
			Blocked = Instance.new("BindableEvent"),
			Error = Instance.new("BindableEvent"),
			Stopped = Instance.new("BindableEvent"),
		},
		_agent = agent,
		_humanoid = agent:FindFirstChildOfClass("Humanoid"),
		_path = PathfindingService:CreatePath(agentParameters),
		_status = "Idle",
		_t = 0,
		_position = {
			_last = Vector3.new(),
			_count = 0,
		},
	}, Path)

	--Configure settings
	for setting, value in pairs(DEFAULT_SETTINGS) do
		self._settings[setting] = self._settings[setting] == nil and value or self._settings[setting]
	end

	--Path blocked connection
	self._path.Blocked:Connect(function(...)
		if (self._currentWaypoint <= ... and self._currentWaypoint + 1 >= ...) and self._humanoid then
			setJumpState(self)
			self._events.Blocked:Fire(self._agent, self._waypoints[...])
		end
	end)

	return self
end
