local n={}do local function I()local n=workspace.CurrentCamera local I=n and n.ViewportSize.X or 0 local X=n and n.ViewportSize.Y or 0 if I==0 then return 1024 else if I>X then return I else return X end end end n.ViewSizeX=I local function X()local n=workspace.CurrentCamera local I=n and n.ViewportSize.X or 0 local X=n and n.ViewportSize.Y or 0 if X==0 then return 768 else if I>X then return X else return I end end end n.ViewSizeY=X local function r(n)if n then local I=n:FindFirstChild("\072\117\109\097\110\111\105\100")if I then return n,I else return r(n.Parent)end end end n.FindCharacterAncestor=r local function t(n,I,X)local r=X or{}local u,B,m,W=RayCastIgnoreList(workspace,n,r)if u then if I and u.CanCollide==false then table.insert(r,u)return t(n,I,r)end return u,B,m,W end return nil,nil end n.Raycast=t local function u(n)local I=ZERO_VECTOR2 if#n>0 then for X=1,#n,1 do I=I+n[X]end I=I/#n end return I end n.AveragePoints=u end local I={}local function X(n)local X=n and n.Character if X then local r=I[n]if r and r.Parent==X then return r else I[n]=nil local r=X:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if r then I[n]=r end return r end end end
--------------------------UTIL LIBRARY-------------------------------
local Utility = {}
do
	local function ViewSizeX()
		local camera = workspace.CurrentCamera
		local x = camera and camera.ViewportSize.X or 0
		local y = camera and camera.ViewportSize.Y or 0
		if x == 0 then
			return 1024
		else
			if x > y then
				return x
			else
				return y
			end
		end
	end
	Utility.ViewSizeX = ViewSizeX

	local function ViewSizeY()
		local camera = workspace.CurrentCamera
		local x = camera and camera.ViewportSize.X or 0
		local y = camera and camera.ViewportSize.Y or 0
		if y == 0 then
			return 768
		else
			if x > y then
				return y
			else
				return x
			end
		end
	end
	Utility.ViewSizeY = ViewSizeY

	local function FindCharacterAncestor(part)
		if part then
			local humanoid = part:FindFirstChild("Humanoid")
			if humanoid then
				return part, humanoid
			else
				return FindCharacterAncestor(part.Parent)
			end
		end
	end
	Utility.FindCharacterAncestor = FindCharacterAncestor

	local function Raycast(ray, ignoreNonCollidable, ignoreList)
		local ignoreList = ignoreList or {}
		local hitPart, hitPos, hitNorm, hitMat = RayCastIgnoreList(workspace, ray, ignoreList)
		if hitPart then
			if ignoreNonCollidable and hitPart.CanCollide == false then
				table.insert(ignoreList, hitPart)
				return Raycast(ray, ignoreNonCollidable, ignoreList)
			end
			return hitPart, hitPos, hitNorm, hitMat
		end
		return nil, nil
	end
	Utility.Raycast = Raycast

	local function AveragePoints(positions)
		local avgPos = ZERO_VECTOR2
		if #positions > 0 then
			for i = 1, #positions do
				avgPos = avgPos + positions[i]
			end
			avgPos = avgPos / #positions
		end
		return avgPos
	end
	Utility.AveragePoints = AveragePoints
end

local humanoidCache = {}
local function findPlayerHumanoid(player)
	local character = player and player.Character
	if character then
		local resultHumanoid = humanoidCache[player]
		if resultHumanoid and resultHumanoid.Parent == character then
			return resultHumanoid
		else
			humanoidCache[player] = nil -- Bust Old Cache
			local humanoid = character:FindFirstChildOfClass("Humanoid")
			if humanoid then
				humanoidCache[player] = humanoid
			end
			return humanoid
		end
	end
end
