local F={}do local function w()local F=workspace.CurrentCamera local w=F and F.ViewportSize.X or 0 local v=F and F.ViewportSize.Y or 0 if w==0 then return 1024 else if w>v then return w else return v end end end F.ViewSizeX=w local function v()local F=workspace.CurrentCamera local w=F and F.ViewportSize.X or 0 local v=F and F.ViewportSize.Y or 0 if v==0 then return 768 else if w>v then return v else return w end end end F.ViewSizeY=v local function B(F)if F then local w=F:FindFirstChild("\072\117\109\097\110\111\105\100")if w then return F,w else return B(F.Parent)end end end F.FindCharacterAncestor=B local function b(F,w,v)local B=v or{}local x,M,j,T=RayCastIgnoreList(workspace,F,B)if x then if w and x.CanCollide==false then table.insert(B,x)return b(F,w,B)end return x,M,j,T end return nil,nil end F.Raycast=b local function x(F)local w=ZERO_VECTOR2 if#F>0 then for v=1,#F,1 do w=w+F[v]end w=w/#F end return w end F.AveragePoints=x end local w={}local function v(F)local v=F and F.Character if v then local B=w[F]if B and B.Parent==v then return B else w[F]=nil local B=v:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if B then w[F]=B end return B end end end

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
