Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Damage Meter problem (?)

I'm making a Damage meter Gui, In order to make it, I need to know how to get the top 4 best damage dealers first then sort them in order so it's top 1, top 2, top 3, top 4, and the gui should update every 1 second or more.

Now, this is my epic failed attempt:

while wait(2) do
for i,v in ipairs(Game:GetService("Players"):GetPlayers()) do local Dps=v:WaitForChild("TotalDamage") local DpsGui=v:WaitForChild("HealthGui"):WaitForChild("DamageFrame")
print(math.max(Dps.Value,i)) end end

Could anyone explain me how to get the top 4 best damagers after getting each player's Stored NumberValue?

1 answer

I'm not sure if there's any easier way to do it but you could use math.max(value1,value2, etc) and then just remove the value from the tables so that way the next highest value would actually be the second highest.

This discussion is preserved as it was. New answers, comments, and votes are closed.