I'm just getting started on a small menu driven notecard giver (for various reasons too boring to mention). Wondering why this refuses to deliver the notecard if the first menu item is chosen (card is in the prim inventory and named correctly). Thanks in advance for any assistance.
[ SAMPLE BEGINS HERE ]
integer dialog_channel= 427; // set a dialog channel
list menu = [ "Menu1", "Menu2" ];
default
{
state_entry()
{
// arrange to listen for dialog answers (from multiple users)
llListen( dialog_channel, "", NULL_KEY, ""
; }
touch_start(integer total_number)
{
llDialog( llDetectedKey( 0 ), "make a choice", menu,
dialog_channel );
}
listen(integer channel, string name, key id, string choice )
{
vector position = llGetPos();
// if a valid choice was made, implement that choice if possible.
// (llListFindList returns -1 if choice is not in the menu list.)
if ( llListFindList( menu, [ choice ]) != -1 )
{
if ( choice == "Menu1" )
{
llGiveInventory(llDetectedKey(0),"Getting Started"
;}
else if( choice == "Menu2" )
{
llSay(0, "you chose Menu2"
;}
}
else
{
llSay( 0, "Invalid choice: " + choice );
}
}
}
Seagel Neville