Jump to content
  • 0

NPC Usage delay


Magnetix

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  439
  • Reputation:   29
  • Joined:  12/08/11
  • Last Seen:  

I am currently scripting an NPC and decided to add a timer before a player can use

the same NPC. Although gettimetick() works, after testing, I found out that the timer

works IF AND ONLY IF the player stays in-game. If he/she logs out or character selects,

the timer resets and timer ticks back to zero(0).

My Question: Is there other way to make the timer work even if he/she relogs and maybe

resumes when he/she logs back in-game?

Sample Code:

prontera,155,178,4	script	Delay	114,{
set @npcname$,"[Delay]";

if(@delay > gettimetick(2)) {
	mes @npcname$;
	mes "Sorry you have to wait for ^FF0000" +@delay+ "seconds^000000.";
	close;
}
mes @npcname$;
mes "Let's see your patience";
set @delay, gettimetick(2)+@delay;
close;
}

Edited by Magnetix
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   25
  • Joined:  11/23/11
  • Last Seen:  

Don't use '@' vars, use a permanent char var.

set time, gettimetick ( 2 ) + seconds to wait;

if ( time > gettimetick ( 2 ) ) { mes "please wait..."; close ; }

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  439
  • Reputation:   29
  • Joined:  12/08/11
  • Last Seen:  

Don't use '@' vars, use a permanent char var.

set time, gettimetick ( 2 ) + seconds to wait;

if ( time > gettimetick ( 2 ) ) { mes "please wait..."; close ; }

I'll try it out.

EDIT : Late edit, was waiting for the delay to reset. Thanks it worked!

Edited by Magnetix
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...