local Players = game:GetService("Players") local gui = workspace:WaitForChild("Scoreboard"):WaitForChild("SurfaceGui") local label = gui:WaitForChild("Scores") local function score(player) return tonumber(player:GetAttribute("Score")) or 0 end while label.Parent do local list = Players:GetPlayers() table.sort(list, function(a, b) local x, y = score(a), score(b) if x == y then return a.UserId < b.UserId end return x > y end) local rows = {"Top players"} for i = 1, math.min(3, #list) do local player = list[i] table.insert(rows, string.format("%d. %s %d", i, player.DisplayName, score(player))) end label.Text = table.concat(rows, "\n") task.wait(2) end