Pretty much, I am trying to make a damage script. Say I have a sword, and it deals a different amount of damage each time, like (5, 8, 9). But instead of it displaying the individual amount of damage, it displays the total amount of damage done.

How can I fix, and or what should I add to this script to make it work?

I want this script to display the damage differently each time, but it is just showing the total amount of damage being done.

Info: This script is the parent of a BillboardGui inside an NPC's humanoid.

local humanoid = script.Parent
local cHealth = humanoid.Health

humanoid.HealthChanged:Connect(function(health)
	local Gui = script.DamageCounter:Clone()
	local change = math.floor(cHealth - health)
	if change == 0 then return end
	Gui.TextLabel.Visible = true
	Gui.Parent = humanoid.Parent.Head
	Gui.TextLabel.Text = change
	wait(1)
	for i = 0, 1, .1 do
		Gui.TextLabel.TextTransparency = 1
		Gui.TextLabel.TextStrokeTransparency = 1
		wait()
	end
end)

2 comments

0

U want individual numbers that represent the total amount?

0

no, say i have a sword and it does 8 damage. then it does 10 damage. I want the numbers to display, 8 then 10 but this script would show it as "18"