Can you help me? I am trying to save the highscore of the player.
I have created a persistent obj_manager and in the create event I had this:
new SaveFile();
file = ssave_get(SaveFile, ''save'');
Highscore = file.get("highscore");
file.set_protection(SSAVE_PROTECTION.ENCRYPT);
and in another object I pasted this code:
if (global.points > Highscore) {
file.set("highscore", global.points);
Highscore = global.points;
}
in the script I had this:
function SaveFile() : SSave("save") constructor
{
add_value("highscore", SSAVE_TYPE.REAL, 0);
}
this doesn't work and I don't understand why.