Once again, good morning all.
You probably already tired of me: D
In general, for example, the following script:
location,100,100,1 script Example::ex 90,{
if(.speak == 1) goto sorry;
set .speak,1;
set .name$,strcharinfo(0);
mes "[Example]";
mes "Part of this NPC is free, you can talk to him.";
next;
mes "[Example]";
mes "The first player is in conversation with the NPC.";
next;
mes "[Example]";
mes "The first player finishes a conversation with the NPC.";
set .speak,0;
close;
sorry:
mes "";
mes "Sorry. Currently, "+.name$+" is talking to the NPC..";
close;
}
It seems to be working.
But.
If you add a menu.
location,100,100,1 script Example::ex 90,{
if(.speak == 1) goto sorry;
set .speak,1;
set .name$,strcharinfo(0);
mes "[Example]";
mes "Part of this NPC is free, you can talk to him.";
next;
mes "[Example]";
mes "The first player was invited to the menu.";
next;
switch(select("The first menu item:The second menu item:The third menu item") {
case 1:
mes "[Example]";
mes "The first player selected first menu item.";
set .speak,0;
close;
case 2:
mes "[Example]";
mes "The first player selected the second menu item.";
set .speak,0;
close;
case 3:
mes "[Example]";
mes "The first player has chosen the third element of the menu.";
set .speak,0;
close;
sorry:
mes "";
mes "Sorry. Currently, "+.name$+" is talking to the NPC..";
close;
}
By itself, formed a bug - when the NES menu displays, and if you do not select any menu item, and exit the dialog, then the variable. Spectrum is not zero and no longer be able to talk with the NPC. Maybe someone can come up with a workaround?
Thanks in advance.