I'm making a Damage meter Gui, In order to make it, I need to know how to get the top 5 best damage dealers first then sort them in order so it's top 1, top 2, top 3, top 4,and top 5 and the gui should update every second, setting the top 5 damage player leaderboard from top to bottom.
Now, this is my epic failed attempt:
while wait(1) 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 5 best damagers after getting each player's Stored NumberValue?
PD: I postes this 5 days ago, but I still can't be able to do this... somebody help, please. ):

3 comments
Are there any errors?
Nope, I know how to manage everything else, but I'd like to know how to get all player's TotalDamage Value and sort them by top 5, from top to bottom in a gui.
It's sad to see how all questions get answered and this one is the only that remains unanswered.. ):