Jump to content
  • 0

request sample countdown


Question

Posted (edited)

can somebody please show me a sample script that has countdown,

the script flow will be like this.

 

 

when player A click the npc the countdown starts. (ex. 20 sec countdown)

after 20 secs, the npc will announce "player A wins"

 

BUT if player B clicks the npc,while the countdown for player A is still on going,

the countdown will reset, and after 20 secs that no one clicks the npc

the npc will announce "player B wins"

Edited by gleynn

4 answers to this question

Recommended Posts

Posted (edited)

Here you go.

prontera,180,150,4	script	Countdown	-1,{
	set .name$,strcharinfo(0);
	set .acctid,getcharid(3);
	initnpctimer;
	end;
	
	OnTimer20000:
	mapannounce strnpcinfo(4),"The winner is: "+ .name$ +"",0;
	stopnpctimer;
	end;
	
}
Edited by Lionhardt
  • Upvote 1
Posted (edited)

Here you go.

prontera,180,150,4	script	Countdown	-1,{
	set .name$,strcharinfo(0);
	set .acctid,getcharid(3);
	initnpctimer;
	end;
	
	OnTimer20000:
	mapannounce strnpcinfo(4),"The winner is: "+ .name$ +"",0;
	stopnpctimer;
	end;
	
}

i add your script to my script and it works but i didn't include 

set .acctid,getcharid(3); 

 

may i ask? what does this line do?

 

thanks by the way :D

Edited by gleynn
Posted

That sets the variable .acctid to the account ID of the player. Just incase, you wanted to give them some sort of item or whatever, after the 20seconds.

i see, thanks again :D

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