Facepunch.Steamworks Wiki

Set a Stat Value

Stats are stored as int or a float.

Each stat needs to be set up on the Steamworks Site and changes published before you can use them
Steamworks.SteamUserStats.SetStat( "KillCount", totalkills ); Steamworks.SteamUserStats.SetStat( "HealthTaken", totalHealthTaken );

We also have some variants to make incrementing a bit easier

Steamworks.SteamUserStats.AddStat( "KillCount", 1 ); Steamworks.SteamUserStats.AddStat( "HealthTaken", healthTaken );
You should call StoreStats when you want to send the changes to Steam's backend. If the user quits/crashes before you do that then the stats might not be updated remotely.
// // Tell Steam to update the backend // Steamworks.SteamUserStats.StoreStats();