local function h()local h=findPlayerHumanoid(Player)return h~=nil and h.Health>0 end local function n(h)if h~=nil then for h,n in pairs(h:GetChildren())do if n:IsA("\084\111\111\108")then return n end end end end local i=nil local o=nil local c=nil local O=nil local function l()if i then i:Cancel()i=nil end if c then c:Disconnect()c=nil end if O then O:Disconnect()O=nil end if o then o:Destroy()end end
-------------------------------------------------------------------------

local function CheckAlive()
	local humanoid = findPlayerHumanoid(Player)
	return humanoid ~= nil and humanoid.Health > 0
end

local function GetEquippedTool(character)
	if character ~= nil then
		for _, child in pairs(character:GetChildren()) do
			if child:IsA("Tool") then
				return child
			end
		end
	end
end

local ExistingPather = nil
local ExistingIndicator = nil
local PathCompleteListener = nil
local PathFailedListener = nil

local function CleanupPath()
	if ExistingPather then
		ExistingPather:Cancel()
		ExistingPather = nil
	end
	if PathCompleteListener then
		PathCompleteListener:Disconnect()
		PathCompleteListener = nil
	end
	if PathFailedListener then
		PathFailedListener:Disconnect()
		PathFailedListener = nil
	end
	if ExistingIndicator then
		ExistingIndicator:Destroy()
	end
end
