Forja

Roblox leaderboard script

Shows a number beside each player's name in the player list: coins, points, wins. Roblox makes the list by itself from a folder called leaderstats.

Where it goes

  1. 1In the Explorer, hover over ServerScriptService, press + and choose Script.
  2. 2Delete what's in the new Script and paste this in.
  3. 3Press Play: Coins shows beside your name at the top right.
Leaderboard · a Script in ServerScriptService
-- From forja.us/tools/roblox-scripts/leaderboard-- Gives each player a Coins stat, shown in the player list.local Players = game:GetService("Players")local function onPlayerAdded(player)	local leaderstats = Instance.new("Folder")	leaderstats.Name = "leaderstats"	leaderstats.Parent = player	local coins = Instance.new("IntValue")	coins.Name = "Coins"	coins.Value = 0	coins.Parent = leaderstatsendPlayers.PlayerAdded:Connect(onPlayerAdded)

How it works

  • The folder must be named exactly leaderstats and sit in the player: that's what Roblox looks for.
  • Each value in the folder becomes a column. An IntValue holds a whole number.
  • It runs on the server, so other players see it and players can't change it themselves.

Make it yours

Another stat
Copy the three coins lines, with a new name like wins, before the end.
Keep it after they leave
Use the saving script instead: this one starts at 0 each visit.
Want something more? The script generator can write it: “A leaderboard with Coins and Wins, where killing another player adds 1 win”

Maps to try it on: simulator and tycoon maps

Start from a finished map, and your scripts have a game to run in.

More free Roblox scripts