From: Qie Niangao
Really? That is, you can touch the "first" placemat and you get only the dialog for that one, not the second? But if you touch the second one, you get both dialogs? If so, what makes one of these the "first"? (First rezzed? First touched? ... not that I have a ready explanation, in any case.)
By first I mean the first rezzed.
I tried adding an llFrand equation to state_entry, to no avail - here's the script if anyone can look it over.
*NOTE: With this change to the script, my avatar speaks the choices into the world as well, even though the channel isn't 0.
--------------------------------------------------------
list mainmenu = ["Breakfast","Lunch"];
list breakfastmenu = ["Main Menu", "Pastries", "SunnySideEggsandBacon", "Pancakes&Sausage", "Cereal", "Waffles&Strawberries"];
list lunchmenu = ["Main Menu", "Ham&Swiss", "RoastBeef&Cheddar", "Chili", "Cheeseburger", "TomatoSoup"];
key user;
integer channel;
integer n;
integer min = 500000;
default
{
state_entry()
{
integer randint = (integer)llFrand(n + 1);
integer channel = min + randint;
}
touch_start(integer total_number)
{
user = llDetectedKey(0);
llDialog(user,"What Would You Like to Eat?",mainmenu,channel);
llListen(channel,llKey2Name(user),user,""

;
}
listen(integer channel,string name, key id,string message)
{
if(id==user)
{
if(message=="Main Menu"

{
llDialog(user,"Main Menu",mainmenu,channel);
return;
}
if(message=="Breakfast"

{
llDialog(user,"Breakfast Menu",breakfastmenu,channel);
return;
}
if(message=="Lunch"
{
llDialog(user,"Lunch Menu",lunchmenu,channel);
return;
}
if(message=="Pastries"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.065>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="SunnySideEggsandBacon"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.038>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="Pancakes&Sausage"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.038>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="Cereal"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.056>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="Waffles&Strawberries"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.030>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="Ham&Swiss"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.043>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="RoastBeef&Cheddar"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.018>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="Chili"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.056>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="Cheeseburger"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.040>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
if(message=="TomatoSoup"
{
llRezObject(message, llGetPos() + <0.0,0.0,0.056>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
else
{
llRezObject(message, llGetPos() + <0.0,0.0,0.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
return;
}
}
}
}