Reply to Script problem, won't modify variable
If you don't have an account, just leave the password field blank.
This script is spawned when you begin a new game (start1.c); I've also tried spawning it via key script. Everything works, as far as I can tell, except &stamina += 1; doesn't happen for some reason (it remains at 0 as preset in main.c). Dink says the number so that verifies that the condition is working properly. I've tried replacing it with other variables and they didn't change either.
//stamina.c
//&stamina is a global variable
//replenishes stamina var over time
void main ()
{
wait(1);
script_attach(1000);
int &shownum = say_xy("`% Stamina: &stamina", -235, -0);
sp_kill(&shownum, 0);
loop:
wait(200);
if (&stamina < 100)
{
&stamina += 1;
say("&stamina",1);
goto refresh;
}
goto loop;
}
void refresh ()
{
refresh:
sp_active(&shownum,0);
&shownum = say_xy("`% Stamina: &stamina", -235, -0);
sp_kill(&shownum, 0);
goto loop;
}
//stamina.c
//&stamina is a global variable
//replenishes stamina var over time
void main ()
{
wait(1);
script_attach(1000);
int &shownum = say_xy("`% Stamina: &stamina", -235, -0);
sp_kill(&shownum, 0);
loop:
wait(200);
if (&stamina < 100)
{
&stamina += 1;
say("&stamina",1);
goto refresh;
}
goto loop;
}
void refresh ()
{
refresh:
sp_active(&shownum,0);
&shownum = say_xy("`% Stamina: &stamina", -235, -0);
sp_kill(&shownum, 0);
goto loop;
}