What do you want to achieve? Keep it simple and clear!
For the damage to be shown, how much maximum damage can be done in the second
I have the textlabel and like a tracker of some sort to shown how much damage can be done in the second
What is the issue? Include screenshots / videos if possible!
Well i have the textlabel and some of the script
But i dont know how to calculate the damage being done within the second
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Ive been looking online and around the hub to see if theres anything like it, ive only been able to find things releating to doing damage but not amount based of a second
I can provide any answers for any questions needed thanks
Hi, the way I’d go about this is saving the value of each damage dealt to a table, and having it be discarded after 10 seconds. The text will then display all the table values added up and divided by 10.
Yea. To clarify, let’s say you hit an enemy for a value of “X”. X gets saved to the table, and gets schedueled to get removed from said table in 10 seconds.
For the text, the code will be something like
while wait(1) do
local DisplayValue = 0
for _, v in pairs(table) do
DisplayValue = DisplayValue + v
end
textlabel.text = DisplayValue/10
end