this script that displays the damage is not functioning as i'd like it to. what's wrong?
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.
01 | local humanoid = script.Parent |
02 | local cHealth = humanoid.Health |
04 | humanoid.HealthChanged:Connect( function (health) |
05 | local Gui = script.DamageCounter:Clone() |
06 | local change = math.floor(cHealth - health) |
07 | if change = = 0 then return end |
08 | Gui.TextLabel.Visible = true |
09 | Gui.Parent = humanoid.Parent.Head |
10 | Gui.TextLabel.Text = change |
13 | Gui.TextLabel.TextTransparency = 1 |
14 | Gui.TextLabel.TextStrokeTransparency = 1 |