CyberMax
CyberMax › Answers

Roblox leaderboard script: leaderstats you can copy and paste

Updated 2026-10-17 · Roblox and game developers · by CyberMax

Short answer

Create a Folder named exactly "leaderstats" inside each player when they join, and put IntValue or NumberValue objects in it. Roblox shows every value in that folder on the in-game player list. Change the values only from server scripts.

  1. Insert a Script (not a LocalScript) in ServerScriptService and paste the code.
  2. Press Play: Coins and Level appear on the player list at the top right.
  3. To make them save, load and save the values with the DataStore script linked below.

Copy-paste code

ServerScriptService/Leaderstats.server.lua

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	local stats = Instance.new("Folder")
	stats.Name = "leaderstats" -- must be exactly this name, all lowercase
	stats.Parent = player

	local coins = Instance.new("IntValue")
	coins.Name = "Coins"
	coins.Value = 0
	coins.Parent = stats

	local level = Instance.new("IntValue")
	level.Name = "Level"
	level.Value = 1
	level.Parent = stats
end)

-- From any other server script:
-- player.leaderstats.Coins.Value += 10

Good to know

Changing leaderstats from a LocalScript only changes it on that player's screen; other players and the server never see it. Use a RemoteEvent to ask the server, and let the server decide.

The first value in the folder decides the sort order of the player list.

Studwright: Roblox systems that never lose saves

from $12

Studwright is 16 tested Luau modules: session-locked SaveData, Receipts (developer products granted once), Codes, DailyRewards, PlaytimeRewards, Leaderboard, LootTable, Inventory, Currency, RemoteGuard and more, as a drag-in .rbxmx with the tests.

Secure checkout · 14-day fix-or-refund if it doesn't work as described (terms)

Questions

Why doesn't my leaderboard show?

The folder must be named leaderstats (lowercase) and created by a server Script inside the Player object.

Can I show text instead of numbers?

Yes, use a StringValue; it shows as text but the list then can't sort numerically by it.

How do I make a global leaderboard?

Use an OrderedDataStore; see the global leaderboard guide below.

Free: the Roblox Starter Kit

7 free Luau modules (damage, pets, shop formatting, admin audit log, tycoon guards and more) plus 3 free calculators, then 5 short emails with the scripting fixes we see go wrong most often.

You get one email to confirm first. Then the kit, and 5 short emails over two weeks. One-click unsubscribe in every email; we never share your address.

Related answers

Roblox global leaderboard: top players across every serverLuau for an all-time global leaderboard with OrderedDataStore: write scores, read the top 50, refresh within tA Roblox DataStore save script that never wipes player dataCopy-paste Luau for loading and saving player data with DataStoreService: retries, UpdateAsync, BindToClose anRoblox daily rewards script with a login streakA server-side daily reward and streak script for Roblox: UTC day numbers, a streak that resets after a missed