How to find the player with the highest score, the second highest score, and so on? I tried this random thing, but it obviously does not work.
for _, player in pairs(game.Players:GetPlayers()) do
player.PlayerGui.ScreenGui.Frame.Visible = true
local first = math.max(player.leaderstats.Score.Value)
local second = math.min(player.leaderstats.Score.Value)
player.PlayerGui.ScreenGui.Frame.First.Text = first
player.PlayerGui.ScreenGui.Frame.Second.Text = second
end
Thanks!

1 comment
What if I add more players? This is what I tried: https://scriptinghelpers.org/questions/37933/attempt-to-index-local-third-a-nil-value