Showing maximum amount of DPS

  1. 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

  2. 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

  3. 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

1 Like

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.

2 Likes

hmm so saving it to a table, after 10 seconds it discards the save, and displays the table to the textlabel with it divided by 10?

1 Like

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
1 Like

yeah thats what i mean, so then the amount of damage is then saved to the table and then removed after 10 seconds, but is shown and divided by 10

1 Like

Well, the text should display all the values added up, not just the one damage value.

1 Like

yeah i have a textlabel that displays a single amount of damage dealt

when saving, would it be the amount done to the npc, or would it be the amount based of the player?

1 Like