how to make npc dynamic pub? plus questions

mleo1

Community Contributors
Messages
314
Points
0
Age
10
Location
Failippines
Github
mleo1
Emulator
I forgot scripting, rebeginner
default_sob.gif

Questions

1 I wanna make the npc make a pub/waitingroom that shows count of players on specific map for may pvp warper, I dunno how, How please

lol maybe something like this, testing.

while(1){waitingroomsleepdelwaitingroom}


2 Do you always need an 'end' in the end of script? I always see guys use it, but I dont.

- script test -1,{ announce "1",0; end;}
Code:
-    script    test    -1,{        announce "1",0;}
Same?

3. How to run a script once every week, like 12am sunday. what will i say?

 
Last edited by a moderator:
I'm not sure with this too please correct me if im wrong..

Code:
-	script	PvP	-1,{	end;OnInit:	while(1) {	sleep2 5000;	waitingroom "PvP Area [ " + getmapusers("prontera") + " / 100 ] ",0;	end;	}}
 
3.

OnClock<hour><minute>:
OnMinute<minute>:
OnHour<hour>:
On<weekday><hour><minute>:
OnDay<month><day>:
 
This will execute when the server clock hits the specified date or time. 
Hours and minutes are given in military time. ('0105' will mean 01:05 AM). 
Weekdays are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 
to 31. Remember the zero.
default_smile.png
 
Answering to your second question (as the other ones have already been addressed): yes, you can omit the end; sentence if it's the last line of code before the closing curly brace of the NPC since it'll be assumed. Anyways, it's good practice to place it to end your script in any case wherever you'd want to end it, to avoid any possibly unexpected behavior.

 
I'm not sure with this too please correct me if im wrong..

- script PvP -1,{ end;OnInit: while(1) { sleep2 5000; waitingroom "PvP Area [ " + getmapusers("prontera") + " / 100 ] ",0; end; }}
you should use sleep not sleep2 because there is no need for RID?,

and theres an end inside the while loop, it will end, it will make static pub prolly

- script PvP -1,{ end;OnInit: while(1) { 
the end here is good so if you click the npc it will not run the OnINit code again.

Answering to your second question (as the other ones have alreay been addressed): yes, you can omit the end; sentence if it's the last line of code before the closing curly brace of the NPC since it'll be assumed. Anyways, it's good practice to place it to end your script in any case wherever you'd want to end it, to avoid any possibly unexpected behavior.
thanks, Im getting mindfuck since allmost all scripts in other replies has unnessesary end; im gonna use end if necessary only thanks.

3.

OnClock<hour><minute>:
OnMinute<minute>:
OnHour<hour>:
On<weekday><hour><minute>:
OnDay<month><day>:
 
This will execute when the server clock hits the specified date or time. 
Hours and minutes are given in military time. ('0105' will mean 01:05 AM). 
Weekdays are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 
to 31. Remember the zero.
default_smile.png
okie thanks, if I searched OnMinute on scriptcommands.txt I should have seen it and not be stucked. Unluckily, I dont remember anything, lol

 
Back
Top