Jump to content
  • 0

NPC Usage delay


Question

Posted (edited)

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

2 answers to this question

Recommended Posts

Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...