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.

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

Built-In Tool

Config Tool Built Into XGamingServer

Get managed s&box hosting with this tool in your panel — configure, deploy, and play in minutes. No file uploads needed.

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