Client side Damage counter/indicator

Made this years ago. I thought I would share it. Its very basic and simple to use and implement into pre-existing games.

All you need to do is add the two remotes inside of the code and place them and move the billboard gui into replicated storage and the local script into starterplayerscripts.

It also comes with support for kill/hit sounds but you can comment that separate code out if you just want to use the indicator.

If you want to do a timed destroy system that utilises tick then just copy the below code into your script:

DmgIndi.OnClientEvent:Connect(function(damage, target)
	local s = tick()
	
	local DamageNumber = nil 

	--Check if there's already a damage number
	DamageNumber = target.Parent.Head:FindFirstChild('DamageNumber')

	if DamageNumber == nil then
		--There isn't one, make one now
		DamageNumber = game:GetService('ReplicatedStorage').DamageNumber:Clone()
	else
		--There is one, add to it
		damage += tonumber(DamageNumber.TextLabel.Text)
	end

	DamageNumber.Parent = target.Parent.Head
	DamageNumber.TextLabel.Text = tostring(damage)
		
	repeat task.wait() until tick() - s >= 5
	
	print(tick() - s >= 5)

	DamageNumber:Destroy()
end)

No I wont be adding a preview clip.


Code:
damageIndi.rbxm (6.5 KB)

1 Like

A Showcase video would be good.

No need since its simple so you can spend the 20 seconds it takes to set everything up and look or just don’t use it.

1 Like


jk jk but a video would be nice!

3 Likes

Please RE to the following quote:

1 Like

oh okay great job tho :grin:

(eeee)

1 Like

No problem. I did have a version that had a couple tweens and stuff to make the number popup and fade randomly in a random direction on the z or x axis but I lost it since I didn’t backup my old game before leaving my old group which got sniped.

For a little more insight it would’ve looked similar to Fortnite’s damage indicator.

I would’ve posted that one here instead but I thought I may aswell upload this base for anyone else to enjoy.