xgaming.tools

s&box Stats / Leaderboard / Achievement Generator

Generate Sandbox.Services C# code for player stats, leaderboards (with all 5 aggregation modes — Sum/Avg/Min/Max/Last), and achievement unlocks. Pulls method signatures direct from the live s&box C# API schema — Stats.Increment, Leaderboards.GetFromStat, Achievements.Unlock — so the snippets always match the engine exactly.

s&box server hosting from XGamingServer — instant setup, DDoS protection, mod support, and 24/7 help. 30% off your first month.

Lowercase + underscore is the s&box convention. The same key feeds into a leaderboard later.

Tag the increment with a string for analytics segmentation.

Sandbox.Services — Stats, Leaderboards, Achievements

Three closely-related APIs on Facepunch's backend power the progression layer of any s&box game. Stats records numeric values per player and globally. Leaderboards aggregate those stats and order them. Achievements are one-shot unlocks per player. All three live under Sandbox.Services and are pulled straight from the s&box C# API schema in the snippets above — no drift when Facepunch revises the API.

Stats API (11 methods)

From Sandbox.Services.Stats:

MethodReturn
FlushAsync(token)Task
Flush()void
FlushAndWaitAsync(token)Task
Increment(name, amount)void
Increment(name, amount, context, data)void
Increment(name, amount, data)void
SetValue(name, amount, context, data)void
SetValue(name, amount, data)void
GetGlobalStats(packageIdent)Stats.GlobalStats
GetLocalPlayerStats(packageIdent)Stats.PlayerStats
GetPlayerStats(packageIdent, steamid)Stats.PlayerStats

Leaderboard Aggregation Modes

MethodWhen to use
SetAggregationSum()Default — total kills, total points, total distance.
SetAggregationAvg()Average per submission — useful for K/D ratios.
SetAggregationMin()Best low score — speedruns, golf-style scoring.
SetAggregationMax()Personal best — high scores, longest run.
SetAggregationLast()Most recent value wins — current state, current rank.

Related Tools

s&box Stats / Leaderboard / Achievement Generator — FAQ

Is this s&box Stats / Leaderboard / Achievement Generator free to use?

Yes, the s&box Stats / Leaderboard / Achievement Generator is 100% free — no signup required, no hidden fees, no downloads. Everything runs in your browser.

How accurate is the s&box Stats / Leaderboard / Achievement Generator?

Values are pulled from the s&box game files and community-verified formulas. Results match what you see in-game, and we update the tool when the game gets major patches.

Can I host a s&box server with XGamingServer?

Yes. XGamingServer offers instant s&box server hosting with mod support, automatic backups, DDoS protection, and 24/7 support. All popular game settings are pre-configured.

Does the Stats / Leaderboard / Achievement Generator work on mobile?

Yes, the Stats / Leaderboard / Achievement Generator is fully responsive and works on desktop, tablet, and mobile browsers.

You might also need

s&box server admin docs

Read the full s&box server docs →

Step-by-step guides for installing mods, configuring your server, joining, troubleshooting, and admin commands.

Ready to play?

Run your own s&box server with XGamingServer

Instant setup, mods & plugins, DDoS protection and 24/7 human support — your server is live in minutes, no port-forwarding required.

99.9%
Uptime SLA
< 5 min
Instant setup
24/7
Human support
DDoS
Protected

Pick your plan

See all plans
Starter$8.40/mo4 GB RAMRenews $12/moBuy now
PopularNovice$10.50/mo6 GB RAMRenews $15/moBuy now
Rookie$17.50/mo8 GB RAMRenews $25/moBuy now
Pro$24.50/mo12 GB RAMRenews $35/moBuy now
Built-In Tool

s&box Server Hosting

Get managed s&box server hosting with this tool built into your panel — configure, deploy, and play in minutes. Instant setup, DDoS protection, 24/7 support.

Built-In Config ToolInstant Server SetupDDoS ProtectionExpert 24/7 Support
Get 40% OFFNo setup fees · Cancel anytime