var coins = 20;
//either
var fldr = app.GetPrivateFolder( "data" );
app.WriteFile( fldr + "/coins", coins );
//or else
app.SaveNumber( "coins", coins );
They both write to the app's private space.
The first way is more flexible as it actually writes a file, instead of a value in a database.
It is especially useful if you want to save something that is not text, a number or a boolean value.