the mechanics are, a player have to draw a number. rand(1,16) if that player draws number 1 no one in the server can pick number 1 again. Thus, when a player "draws" another number 1 if someone have already drawn that number, the script will loop until it finds another number that have not yet been chosen.
here's my unfinished script since i don't know what to do with the loop:
prontera,153,138,3 script Tournament Official 405,{
set .drawlats,rand(1,16);
if ( .drawlats == 1 && $@potm != 1 ) {
set $@potm,1;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You picked number 1!";
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 1st Combatant!",0;
end;
Hope someone knows what i'm talking about. I'm using 3ceam anyways so please don't use ra tags.
Thanks.
it worked somehow after whole day of scripting.
my only problem is how to remove 1 number if it's already chosen?
Example:
if number 1 is chosen, the rand will not read 1 again.
It's time consuming to get redirected again and again to get a number.
here's my current script
cell_game,155,140,3 script Tournament Official 405,{
l_potm_start2:
set .potmdraw,rand(1,16);
//if ( $@potmsv1 == 1 || $@potmsv2 == 1 || $@potmsv3 == 1 ) goto l_potm_start;
mes "[Tournament Official]";
mes "You can now pick a number!";
menu "Pick a number",l_potm_start;
l_potm_start:
if ( $@potmsv1 == 1 && $@potmsv2 == 1 && $@potmsv3 == 1 && $@potmsv4 == 1 && $@potmsv5 == 1 && $@potmsv6 == 1 && $@potmsv7 == 1 && $@potmsv8 == 1 && $@potmsv9 == 1 && $@potmsv10 == 1 && $@potmsv11 == 1 && $@potmsv12 == 1 && $@potmsv13 == 1 && $@potmsv14 == 1 && $@potmsv15 == 1 && $@potmsv16 == 1 ) {
next;
mes "[Tournament Official]";
mes "All numbers were drawn. Better luck next time!";
close;
}
if ( .potmdraw == 1 && $@potmsv1 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #1!";
set $@potmsv1,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 1st combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 2 && $@potmsv2 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #2!";
set $@potmsv2,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 2nd combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 3 && $@potmsv3 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #3!";
set $@potmsv3,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 3rd combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 4 && $@potmsv4 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #4!";
set $@potmsv4,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 4th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 5 && $@potmsv5 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #5!";
set $@potmsv5,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 5th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 6 && $@potmsv6 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #6!";
set $@potmsv6,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 6th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 7 && $@potmsv7 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #7!";
set $@potmsv7,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 7th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 8 && $@potmsv8 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #8!";
set $@potmsv8,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 8th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 9 && $@potmsv9 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #9!";
set $@potmsv9,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 9th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 10 && $@potmsv10 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #10!";
set $@potmsv10,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 10th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 11 && $@potmsv11 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #11!";
set $@potmsv11,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 11th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 12 && $@potmsv12 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #12!";
set $@potmsv12,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 12th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 13 && $@potmsv13 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #13!";
set $@potmsv13,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 13th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 14 && $@potmsv14 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #14!";
set $@potmsv14,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 14th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 15 && $@potmsv15 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #15!";
set $@potmsv15,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 15th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 16 && $@potmsv16 != 1 ) {
next;
mes ".";
next;
mes ".";
mes "..";
next;
mes ".";
mes "..";
mes "...";
next;
mes "[Tournament Official]";
mes "Congratulations!";
mes "You have drawn #16!";
set $@potmsv16,1;
close2;
mapannounce "cell_game","Tournament Official : "+strcharinfo(0)+" will be the 16th combatant in the POTM Tournament!",0;
//warp "poring_w02",99,85;
end;
}
if ( .potmdraw == 1 && $@potmsv1 == 1 || .potmdraw == 2 && $@potmsv2 == 1 || .potmdraw == 3 && $@potmsv3 == 1 || .potmdraw == 4 && $@potmsv4 == 1 || .potmdraw == 5 && $@potmsv5 == 1 || .potmdraw == 6 && $@potmsv6 == 1 || .potmdraw == 7 && $@potmsv7 == 1 || .potmdraw == 8 && $@potmsv8 == 1 || .potmdraw == 9 && $@potmsv9 == 1 || .potmdraw == 10 && $@potmsv10 == 1 || .potmdraw == 11 && $@potmsv11 == 1 || .potmdraw == 12 && $@potmsv12 == 1 || .potmdraw == 13 && $@potmsv13 == 1 || .potmdraw == 14 && $@potmsv14 == 1 || .potmdraw == 15 && $@potmsv15 == 1 || .potmdraw == 16 && $@potmsv16 == 1 ) {
next;
mes "[Tournament Official]";
mes "Please pick another number because that number is already taken!";
close2;
goto l_potm_start2;
end;
}
end;
}
//Server Reseter
cell_game,152,141,3 script Server Reseter 888,{
set $@potmsv1,0;
set $@potmsv2,0;
set $@potmsv3,0;
set $@potmsv3,0;
set $@potmsv4,0;
set $@potmsv5,0;
set $@potmsv6,0;
set $@potmsv7,0;
set $@potmsv8,0;
set $@potmsv9,0;
set $@potmsv10,0;
set $@potmsv11,0;
set $@potmsv12,0;
set $@potmsv13,0;
set $@potmsv14,0;
set $@potmsv15,0;
set $@potmsv16,0;
end;
}
Question
Yomigaeru
hey ra.
I'm currently scripting a "draw npc".
the mechanics are, a player have to draw a number. rand(1,16) if that player draws number 1 no one in the server can pick number 1 again. Thus, when a player "draws" another number 1 if someone have already drawn that number, the script will loop until it finds another number that have not yet been chosen.
here's my unfinished script since i don't know what to do with the loop:
Hope someone knows what i'm talking about. I'm using 3ceam anyways so please don't use ra tags.
Thanks.
it worked somehow after whole day of scripting.
my only problem is how to remove 1 number if it's already chosen?
Example:
if number 1 is chosen, the rand will not read 1 again.
It's time consuming to get redirected again and again to get a number.
here's my current script
Help please?
Link to comment
Share on other sites
7 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.