local a={}a.all={}function a.new(D,V)local W=newIndicator or{}W.time=3.2*math.max(.24,damagedone/100)or 1 W.position=((humanoid:FindFirstChild("\099\114\101\097\116\111\114")).Value.Character:FindFirstChild("\084\111\114\115\111")).Position or Vector3.new()print(W.position)W.timeCreated=tick()W.timeExpire=tick()+W.time W.alive=true W.frame=frTemplate:clone()W.frame.Parent=gui W.frame.Archivable=false setmetatable(W,a)D.__index=D table.insert(a.all,W)W:update()return W end function a.expire(V)V.alive=false V.frame:Destroy()for D=1,#a.all,1 do if V==a.all[D]then table.remove(a.all,D)break end end end function a.setAngle(V,a)if not V.alive then return end local D=a*(180/math.pi)V.frame.Position=UDim2.new(.5,math.cos(a)*radius+V.frame.AbsoluteSize.X/-2,.5,math.sin(a)*radius+V.frame.AbsoluteSize.Y/-2)V.frame.Rotation=D+90 end function a.update(a)if tick()>=a.timeExpire then a:expire()else local V=(tick()-a.timeCreated)/a.time a:setAngle((getCameraAngle(camera)-angleBetweenPoints(camera.Focus.p,a.position))-math.pi/2)a.frame.ImageLabel.ImageTransparency=V a.frame.ImageLabel.Size=UDim2.new(0,350,0,350*(1-V))end end function a.updateAll(V)local D=1 while D<=#a.all do local V=a.all[D]V:update()if V.alive then D=D+1 end end end
-- Indicator class

local Indicator = {}
Indicator.all = {}

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

	-- Properties
	newIndicator.time = (3.2 * math.max(0.24, (damagedone / 100))) or 1
	newIndicator.position = humanoid:FindFirstChild("creator").Value.Character:FindFirstChild("Torso").Position
		or Vector3.new()
	print(newIndicator.position)
	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)
	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, 350, 0, 350 * (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
