local Y={}Y.all={}function Y.new(o,n)local C=n or{}C.time=C.time or 1 C.position=C.position or Vector3.new()C.timeCreated=tick()C.timeExpire=tick()+C.time C.alive=true C.frame=frTemplate:clone()C.frame.Parent=gui C.frame.Archivable=false setmetatable(C,Y)o.__index=o table.insert(Y.all,C)C:update()return C end function Y.expire(n)n.alive=false n.frame:Destroy()for o=1,#Y.all,1 do if n==Y.all[o]then table.remove(Y.all,o)break end end end function Y.setAngle(n,Y)assert(n,"\117\115\101 \099\111\108\111\110")if not n.alive then return end local o=Y*(180/math.pi)n.frame.Position=UDim2.new(.5,math.cos(Y)*radius+n.frame.AbsoluteSize.X/-2,.5,math.sin(Y)*radius+n.frame.AbsoluteSize.Y/-2)n.frame.Rotation=o+90 end function Y.update(Y)if tick()>=Y.timeExpire then Y:expire()else local n=(tick()-Y.timeCreated)/Y.time Y:setAngle((getCameraAngle(camera)-angleBetweenPoints(camera.Focus.p,Y.position))-math.pi/2)Y.frame.ImageLabel.ImageTransparency=n Y.frame.ImageLabel.Size=UDim2.new(0,50,0,-50*(1-n))end end function Y.updateAll(n)local o=1 while o<=#Y.all do local n=Y.all[o]n:update()if n.alive then o=o+1 end end end
-- Indicator class

local Indicator = {}
Indicator.all = {}

function Indicator:new(newIndicator)
	local newIndicator = newIndicator or {}

	-- Properties
	newIndicator.time = newIndicator.time or 1
	newIndicator.position = newIndicator.position or Vector3.new()

	newIndicator.timeCreated = tick()
	newIndicator.timeExpire = tick() + newIndicator.time
	newIndicator.alive = true

	newIndicator.frame = frTemplate:clone()
	newIndicator.frame.Parent = gui
	newIndicator.frame.Archivable = false

	setmetatable(newIndicator, Indicator)
	self.__index = self
	table.insert(Indicator.all, newIndicator)

	newIndicator:update()

	return newIndicator
end

function Indicator:expire()
	self.alive = false

	-- Cleanup resources
	self.frame:Destroy()

	-- Remove from all
	for i = 1, #Indicator.all do
		if self == Indicator.all[i] then
			table.remove(Indicator.all, i)
			break
		end
	end
end

function Indicator:setAngle(angleRadians)
	assert(self, "use colon")
	if not self.alive then
		return
	end

	local angleDegrees = angleRadians * (180 / math.pi)
	self.frame.Position = UDim2.new(
		0.5,
		math.cos(angleRadians) * radius + self.frame.AbsoluteSize.X / -2,
		0.5,
		math.sin(angleRadians) * radius + self.frame.AbsoluteSize.Y / -2
	)
	self.frame.Rotation = angleDegrees + 90
end

function Indicator:update()
	if tick() >= self.timeExpire then
		self:expire()
	else
		local perc = (tick() - self.timeCreated) / self.time
		self:setAngle(getCameraAngle(camera) - angleBetweenPoints(camera.Focus.p, self.position) - math.pi / 2)

		self.frame.ImageLabel.ImageTransparency = perc
		self.frame.ImageLabel.Size = UDim2.new(0, 50, 0, -50 * (1 - perc))
	end
end

function Indicator:updateAll()
	local i = 1
	while i <= #Indicator.all do
		local indicator = Indicator.all[i]
		indicator:update()
		if indicator.alive then
			i = i + 1
		end
	end
end
