Skip to content

A Leaderboard That Remembers

By the end of this page your game will have a stat on the in-game leaderboard, that stat will still be there when a player rejoins, and a physical sign in the world will show the top ten players across every server.

Time: 20 to 30 minutes.

Cost: about five messages. Build messages are charged by how much work each one takes rather than a flat rate, with a minimum of 0.1 credits per message — the credits pill in the dashboard header shows your balance.

You need: Roblox Studio open on a place you can edit, and the Revix plugin connected — the pill at the top of the dashboard should show your game's name with a green dot. If it does not, start with Setup.

What you're building

Two different things that people often confuse. The small list in the top-right corner of the screen is the in-server leaderboard, and it only knows about players who are in your server right now. A global top ten is something else entirely: a saved ranking across every server your game has ever run, which has to live on a real object in the world so players can walk up and read it.

Done looks like this: you press Play, your name and score appear top right, you earn some points, you stop and rejoin and the score is still yours — and a stone sign near spawn lists the ten highest scores in the game.


Step 1 — Add the stat

text
Add a leaderstat called Points to my game. Every player starts at 0, it shows on the in-game leaderboard in the top right corner, and it is stored on the server so a player cannot change their own. Put the tuning values in a config module rather than typed inline.

What happens. The code goes into ServerScriptService, because leaderboard stats are set up by the server when a player joins. You will see a short checklist tick through, then a summary with a "Where to find it" list showing the exact path of every script it created.

Check it worked. Press Play. Your username should appear in the top-right list with Points 0 next to it.

Step 2 — Give players a way to score

text
Put five glowing blue point pads around the spawn area, about 6 studs square and flat on the ground. Standing on one adds 1 Point every second on the server, up to a maximum of 10 points per pad per player per visit. Add a small floating label above each pad that reads POINT PAD. Rate limit it so a player standing on two pads cannot double dip.

What happens. Parts and logic get built together. Anything that grants a stat is written on the server and rate-limited per player as a matter of course — you do not have to ask for that.

Check it worked. Press Play and stand on a pad. Points should climb one per second and stop at 10.

Step 3 — Make the score survive a rejoin

text
Save Points with a DataStore so it comes back when a player rejoins. Save when the player leaves and again when the server shuts down, with retries so a failed save is tried again rather than dropped. Never overwrite a loaded score with 0 if the load failed — leave the player unsaved for that session instead and warn in the output.

What happens. Revix writes saves inside retry handling and adds a shutdown save by default. The last sentence of the prompt is worth copying every time you ask for saving: the classic way to lose a player's progress is to treat a failed load as a score of zero and then save that over the top.

Check it worked. Press Play, earn some points, stop, press Play again. Your Points should be where you left them. If they reset, see the fixes at the bottom of this page.

Step 4 — Build the global top-ten sign

text
Build a leaderboard sign near the spawn: a stone plinth with a tall dark panel on top, about 12 studs wide and 16 studs tall, facing the spawn point. Put a display on the front of the panel with a title reading TOP PLAYERS and ten numbered rows, each with a rank, a player name and a score. Style it dark with one bright accent colour and make the top three rows stand out.

What happens. A sign built from parts appears in Workspace with a display drawn onto its front face. At this stage the rows are placeholders — you are building the object before you fill it.

Check it worked. Walk up to the sign in Studio. You should be able to read TOP PLAYERS and ten rows from a normal player's viewing distance. If the text is tiny or squashed, say so and ask for it bigger.

Step 5 — Fill it with real global data

text
Make the TOP PLAYERS sign show the real global top ten by Points across every server, using an OrderedDataStore. Publish each player's score when they leave and on shutdown rather than every time it changes, refresh the sign every 60 seconds, and show the player's username next to each score. If the data cannot be fetched, leave the last good list up instead of blanking the sign.

What happens. The publishing and fetching both happen on the server. The refresh interval matters: hammering a datastore every time a number changes is the fastest way to get your requests throttled, which is why the prompt says on leave and on shutdown.

Check it worked. Press Play, earn points, then stop the playtest so your score gets published. Press Play again and wait a minute. Your name should appear on the sign. Then ask:

text
Read the output window and tell me whether any datastore calls failed or were throttled in that last playtest.

Step 6 — Prove the ranking logic

text
Write and run a test for the leaderboard: check that ten scores sort highest first, that a tie does not drop a player off the list, that a player who improves their score replaces their old entry rather than appearing twice, and that an empty leaderboard renders without erroring. Then tell me plainly which parts of this you could not verify without a playtest.

What happens. Revix can write a Luau test, run it in your place and report each check as a pass or a failure with the failing ones named. What it cannot check from edit mode is anything that only exists while a player is actually in the game — it is required to tell you which parts those were rather than quietly implying it tested everything.


Make it yours

text
Add a second global sign next to the first showing the top ten by longest time played.
text
Add a small crown above the head of whichever player in this server currently has the most Points, and move it when someone overtakes them.
text
Add tabs on the sign for All Time, This Week and This Server, with the weekly board resetting every Monday.
text
Show each player their own global rank in a small pill under the in-game leaderboard, updating when the sign refreshes.
text
Make the top three rows on the sign gold, silver and bronze, with a soft glow on the first place row.

If something goes wrong

Points reset to zero on every rejoin.

text
Points goes back to 0 every time I rejoin in Studio. Tell me exactly what I need to switch on in Studio for saving to work, then read the output window and fix any errors you find.

The sign stays empty or shows placeholder names.

text
The TOP PLAYERS sign is still showing placeholder rows after a full playtest. Read the output window, find why the ranking fetch is not returning data, name the cause in one sentence, then fix it.

The sign text is unreadable from the ground.

text
The text on the leaderboard sign is too small to read from where players stand. Make the rows taller and the text bigger so it is readable from 40 studs away, and keep it inside the panel.

The same player appears twice.

text
One player appears twice on the global board with two different scores. Make each player key unique in the ranking store so a new score replaces the old one instead of adding a row.

The build stopped before it finished. You will see a card reading "That one stopped early" with a Keep going button. Press it, or type continue. Nothing already built is undone.

Next