menu_bookDocumentation
Achievements: Score-Based and Stat-Based Player Unlocks
s&box achievements allow players to unlock rewards with configurable scores. The API lives in Sandbox.Services.Achievements.
Score
Each achievement has a score (5-100). Low values for easy achievements, high for hard ones. Total combined score per game cannot exceed 1000. Unlocked scores add to the player's global score.Stat Based Achievements
Set unlock mode to "Stat" for automatic unlocking based on stat values:- Target Stat: the stat name (e.g. "coins")
- Aggregation: Sum
- Min/Max Value: unlock threshold
- Show Progress: displays percentage
Manual Achievements
Unlock directly in code:CSHARP
Sandbox.Services.Achievements.Unlock( "achievement_ident" );Listing Achievements
CSHARP
foreach ( var a in Sandbox.Services.Achievements.All )
{
// access achievement properties
}Also available via REST API: https://services.facepunch.com/sbox/achievement/list?package=facepunch.testbed
Was this helpful?