Jump to content
  • 0
Sign in to follow this  
nuna

Adding in game timer count down

Question

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 :( you can wish again after [COUNT DOWN AFTER CLAIMING] 

24 hours are over

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
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.

Share this post


Link to post
Share on other sites
  • 0

 

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"

Share this post


Link to post
Share on other sites
  • 0

 

 

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

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;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.