local function T()local T=findPlayerHumanoid(Player)return T~=nil and T.Health>0 end local function N(T)if T~=nil then for T,N in pairs(T:GetChildren())do if N:IsA("\084\111\111\108")then return N end end end end local e=nil local E=nil local Z=nil local G=nil local function l()if e then e:Cancel()e=nil end if Z then Z:Disconnect()Z=nil end if G then G:Disconnect()G=nil end if E then E: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
