Skip To Content
Not affiliated with Roblox Corporation. 9Roblox never asks for your password and never offers free Robux.

How To Make A Leaderboard With Leaderstats

Roblox Studio · Game Mechanics · Updated

Create a Roblox PlayerList scoreboard with leaderstats, sort columns using IsPrimary and Priority, update scores safely, and scale to OrderedDataStores.

Difficulty
Beginner
Time Needed
10 To 15 Minutes
Folder Name Rule
leaderstats (Strictly All Lowercase Under Player)
Supported Stat Objects
IntValue, NumberValue, StringValue
Column Ordering Objects
IsPrimary (BoolValue) And Priority (NumberValue)
Hide PlayerList API
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

How Roblox PlayerList Views And Leaderstats Work

Roblox includes a built-in PlayerList leaderboard in the upper-right corner of the screen with three tabs: Here displays live session statistics for players inside the current server, while Friends and Global display persistent rankings backed by an OrderedDataStore registered in Creator Hub. Whenever a server Script parents a Folder named leaderstats directly onto a Player instance, the Here view automatically reads every IntValue, NumberValue, and StringValue placed inside that folder and turns each object's Name into a column header.

Spelling and casing are unforgiving: naming the folder Leaderstats or LeaderStats prevents the PlayerList from recognizing it at all. Likewise, update stats exclusively through their Value property (such as coins.Value += 25) rather than overwriting the variable reference itself.

Build A Multi-Column Leaderstats Script In ServerScriptService

Insert a server Script inside ServerScriptService to initialize every player's columns as soon as they join. The complete Luau example below adds Wins, Coins, and a reactive Rank title that upgrades automatically through a Changed listener whenever a player's Coins pass a new threshold. Notice the startup loop over Players:GetPlayers() at the bottom—that extra pass guarantees the first player during fast solo Studio tests never misses initialization if an earlier line yielded.

local Players = game:GetService("Players")

local function getRankTitle(coins: number): string
	if coins >= 500 then
		return "Gold"
	elseif coins >= 150 then
		return "Silver"
	else
		return "Bronze"
	end
end

local function setupLeaderboard(player: Player)
	if player:FindFirstChild("leaderstats") then
		return
	end

	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

	local wins = Instance.new("IntValue")
	wins.Name = "Wins"
	wins.Value = 0
	wins.Parent = leaderstats

	local isPrimary = Instance.new("BoolValue")
	isPrimary.Name = "IsPrimary"
	isPrimary.Value = true
	isPrimary.Parent = wins

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

	local coinsPriority = Instance.new("NumberValue")
	coinsPriority.Name = "Priority"
	coinsPriority.Value = 10
	coinsPriority.Parent = coins

	local rank = Instance.new("StringValue")
	rank.Name = "Rank"
	rank.Value = getRankTitle(coins.Value)
	rank.Parent = leaderstats

	local rankPriority = Instance.new("NumberValue")
	rankPriority.Name = "Priority"
	rankPriority.Value = 5
	rankPriority.Parent = rank

	coins.Changed:Connect(function(newAmount)
		rank.Value = getRankTitle(newAmount)
	end)
end

Players.PlayerAdded:Connect(setupLeaderboard)
for _, existingPlayer in Players:GetPlayers() do
	setupLeaderboard(existingPlayer)
end

Control Column Order Using IsPrimary And Priority

Without explicit ordering rules, Roblox arranges PlayerList columns in whichever sequence scripts create the Value objects—which often shuffles unpredictably when separate modules add stats during login. Two child objects nested directly inside each stat lock column placement cleanly across every platform.

Adding a BoolValue named IsPrimary set to true pins that stat to the leading column. Adding a NumberValue named Priority orders remaining columns numerically, where higher numbers appear earlier and unlabeled stats default to 0. IsPrimary always takes precedence over Priority; if two stats both carry IsPrimary set to true, their Priority values break the tie.

Update Stats Safely And Hide The PlayerList When Needed

Always modify leaderstats inside server Scripts—never from a LocalScript—so score increases replicate accurately to every client and remain protected against client tampering. When a collectible part or round manager awards currency, read player:FindFirstChild("leaderstats"), locate the target IntValue, and increment its Value property on the server.

During full-screen title menus, cutscenes, or custom HUD overlays where the default top-right PlayerList would get in the way, toggle visibility from a LocalScript in StarterPlayerScripts using StarterGui:SetCoreGuiEnabled(). Passing false hides the scoreboard cleanly, and calling it again with true restores the board once gameplay begins.

local StarterGui = game:GetService("StarterGui")

-- Hide the default Roblox PlayerList during a menu or cutscene
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

Upgrade To Persistent Friends And Global Rankings

Standard leaderstats reset as soon as a player leaves the server unless paired with storage. To populate the built-in Friends and Global tabs without coding a custom scoreboard UI, write one numeric score per player keyed by UserId into an OrderedDataStore from a server Script wrapped in pcall(), then register and activate that OrderedDataStore on the Leaderboard page inside Creator Hub.

Keep in mind that while an experience can configure multiple leaderboard definitions, only one registered OrderedDataStore can stay active in the PlayerList at a time; deactivating it hides the Friends and Global views without deleting any saved scores.

Troubleshoot Missing Columns And Studio Timing Issues

If the scoreboard stays blank during playtesting, check four frequent causes. First, verify that the folder is spelled strictly leaderstats in all lowercase and parented straight to the Player rather than the Character model. Second, ensure the creation code runs in a server Script inside ServerScriptService—client-created leaderstats folders never appear to other players.

Third, keep stat names short and limit active columns to two or three primary metrics, because phone screens and compact viewports truncate extra columns quickly. Fourth, double-check that you are assigning to stat.Value instead of overwriting the IntValue variable itself.

More In Game Mechanics