gleynn Posted August 26, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 63 Reputation: 2 Joined: 08/10/12 Last Seen: December 31, 2022 Share Posted August 26, 2013 (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 August 26, 2013 by gleynn Quote Link to comment Share on other sites More sharing options...
GmOcean Posted August 26, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted August 26, 2013 (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 August 26, 2013 by Lionhardt 1 Quote Link to comment Share on other sites More sharing options...
gleynn Posted August 27, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 63 Reputation: 2 Joined: 08/10/12 Last Seen: December 31, 2022 Author Share Posted August 27, 2013 (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 Edited August 27, 2013 by gleynn Quote Link to comment Share on other sites More sharing options...
GmOcean Posted August 28, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted August 28, 2013 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. Quote Link to comment Share on other sites More sharing options...
gleynn Posted August 28, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 63 Reputation: 2 Joined: 08/10/12 Last Seen: December 31, 2022 Author Share Posted August 28, 2013 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 Quote Link to comment Share on other sites More sharing options...
Question
gleynn
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 gleynnLink to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.