Smart Kitty
Well-known member
Heya again, I am trying to build a system that manages a variable per level. I have done a script for the level and set it as level updatescript and I have set a localvariable to avoid using globalvars when is not really necesary so built a test and seems like executing only one time? it starts at 0 and become 1 and it does not increases more, while the test is making it go up infinite. There's the script.
C:
void main(){
int level_progress = getlocalvar("lvlprogress");
level_progress++;
drawstring(0, 0, 0, "" + level_progress, 5000);
}
void oncreate(){
int level_progress = setlocalvar("lvlprogress", 0);
}
void ondestroy(){
clearlocalvar();
}