0 views0 copies0 likes
Live Top Three Scoreboard for a Lobby
Universal script
Copy it, then test it in your own Studio place.
Script code
19 lines · 0.7 KBlocal 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 endwhile 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]-- …open Get script for the full sourceAbout this script
Install this server Script and put a TextLabel named Scores inside the SurfaceGui on Workspace.Scoreboard. Every two seconds it ranks connected players by the numeric Score attribute and lists the first three with deterministic tie breaking. Update Score from your round or checkpoint system. Test equal scores and a player leaving the game before connecting it to prizes.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.