Usage: gms_statistic_set ( name, value )


Saves a new value for the statistic.


//Increase number of pixels walked
var old_value;
old_value = gms_statistic_get("pixels_walked");
gms_statistic_set("pixels_walked", old_value + 5)

Replies (4)

Last message on 25 Sep 2017

Chibi on 24 Jul 2017, 13:21:33
I Was Trying To Add The Kills And Deaths To The Scoreboard (Highscore List) With The Code That You've put In The Example "gms_statistic_set("deaths", gms_statistic_get("deaths") + 1);", but it's still not tracking the kills and deaths on the scoreboard.
What could be possibly wrong ?
Size43 (Administrator) on 4 Sep 2017, 16:00:19
Apologies for the delay, I've been having some health issues.

Did you add a statistic named deaths on this site?
Chibi on 6 Sep 2017, 00:32:18
yes I did
Size43 (Administrator) on 25 Sep 2017, 16:28:41
Apologies for the delay.

Do you actually want to use the statistics, or are you trying to add something to a highscorelist? For highscores, you'll need to use the gms_highscore_* functions.