Adding in game timer count down

nuna

New member
Messages
136
Points
0
Emulator
if(gettimetick(2) - lastTimeTalked > (60 * 60 * 24)) {} mes "Okay have fun with it!"; set lastTimeTalked,gettimetick(2); close; case 2: mes .@rewname$; mes "Okay goodbye!"; close; case 3: close; } } mes .@rewname$; mes "Sorry :("; mes "You can wish again after"; mes "24 Hours are over!"; close;}
How to make the Sorry
default_sad.png
you can wish again after [COUNT DOWN AFTER CLAIMING] 

24 hours are over

 
if( gettimetick(2) < lastTimeTalked ) {mes "You talked recently";close;} else {set lastTimeTalked, gettimetick(2) + ( 3600 * 24 );mes "You may not talk to me again for 24 hours.";close;}
I'm assuming you mean something like this?

If so, then your problem is you didn't actually set ' lastTimeTalked ' to anything. So, you were trying to check if gettimetick(2) - 0 would be greater than ( 60 * 60 * 24 ) [24 hours]. Which of course it will be since it's a number that goes up every second since 1950? 1960?. At anyrate, as long as you set the variable to current time ( gettimetick(2) ) plus 24 hours, then you won't have an issue.

 
if( gettimetick(2) < lastTimeTalked ) {mes "You talked recently";close;} else {set lastTimeTalked, gettimetick(2) + ( 3600 * 24 );mes "You may not talk to me again for 24 hours.";close;}
I'm assuming you mean something like this?

If so, then your problem is you didn't actually set ' lastTimeTalked ' to anything. So, you were trying to check if gettimetick(2) - 0 would be greater than ( 60 * 60 * 24 ) [24 hours]. Which of course it will be since it's a number that goes up every second since 1950? 1960?. At anyrate, as long as you set the variable to current time ( gettimetick(2) ) plus 24 hours, then you won't have an issue.
no sir i mean i want the script be like " You have 2 hrs left to claim another prize"

 
if( gettimetick(2) < lastTimeTalked ) {mes "You talked recently";close;} else {set lastTimeTalked, gettimetick(2) + ( 3600 * 24 );mes "You may not talk to me again for 24 hours.";close;}
I'm assuming you mean something like this?

If so, then your problem is you didn't actually set ' lastTimeTalked ' to anything. So, you were trying to check if gettimetick(2) - 0 would be greater than ( 60 * 60 * 24 ) [24 hours]. Which of course it will be since it's a number that goes up every second since 1950? 1960?. At anyrate, as long as you set the variable to current time ( gettimetick(2) ) plus 24 hours, then you won't have an issue.
no sir i mean i want the script be like " You have 2 hrs left to claim another prize"
 try this

Code:
if( set(.@t, (gettimetick(2) - lastTimeTalked)) < 86400 ) {	mes "Sorry:( you can wish again after"+callfunc("Time2Str", (86400-.@t));	mes "24 hours are over";} else {	mes "Okay have fun with it!";	set lastTimeTalked, gettimetick(2);}close;
 
Back
Top