//Dialog Menu System
integer menu_handler;
integer menu_channel;
menu(key user,string title,list buttons) //make dialog easy, pick a channel by itself and destroy it after 5 seconds
{
menu_channel = (integer)(llFrand(99999.0) * -1); //a different channel at each use
menu_handler = llListen(menu_channel,"","",""
;llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);
}
default
{
touch_start(integer t)
{
menu(llDetectedKey(0),"Information Option Menu",["Info","Other","Other","Other"]);
}
timer() //so the menu timeout and close its listener
{
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
}
listen(integer channel,string name,key id,string message)
{
if (channel == menu_channel) //in case you have others listeners
{
if(message == "Info"

{
llSay(0, "Here's Your Information"
;llGiveInventory(llDetectedKey(0), "Information"
;}
else if(message == "Other"

{
//do other stuffs
}
}
}
}
