Jump to content
  • 0

request sample countdown


gleynn

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  63
  • Reputation:   2
  • Joined:  08/10/12
  • Last Seen:  

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
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  63
  • Reputation:   2
  • Joined:  08/10/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  63
  • Reputation:   2
  • Joined:  08/10/12
  • Last Seen:  

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

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