Jump to content

llGiveInventory not working within dialog script.


naughtyniece
 Share

You are about to reply to a thread that has been inactive for 2781 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi

I have a prim with multiple notecards in it, when someone clicks it shows them in a dialog menu, they choose one and i want it to give it to them then delete it.

 

For some reason the llGiveInventory(llDetectedKey(0) does not give them the notecard can anynine tell me where my issue is, The dalog menu all works perfectly and i get the message and it removes the notecard, but it does not give the notecard....

 

Thank you in advance

 

list MENU1 = [];
list MENU2 = [];
integer listener;
integer MENU_CHANNEL = 1000;


  
Dialog(key id, list menu)
{
    llListenRemove(listener);
    listener = llListen(MENU_CHANNEL, "", NULL_KEY, "");
    llDialog(id, "Select one object below: ", menu, MENU_CHANNEL);
}
 
default
{
     
    touch_start(integer total_number)
    {
        
        integer i = 0;
        MENU1 = [];
        MENU2 = [];
        integer c = llGetInventoryNumber(INVENTORY_NOTECARD);
        if (c <= 12)
        {
            for (; i < c; ++i)
                MENU1 += llGetInventoryName(INVENTORY_NOTECARD, i);
        }
        else
        {        
            for (; i < 11; ++i)
                MENU1 += llGetInventoryName(INVENTORY_NOTECARD, i);
            if(c > 22)
                c = 22;
            for (; i < c; ++i)
                MENU2 += llGetInventoryName(INVENTORY_NOTECARD, i); 
            MENU1 += ">>";
            MENU2 += "<<";                          
        }
        Dialog(llDetectedKey(0), MENU1);
    }
 
    listen(integer channel, string name, key id, string message) 
    {
        if (channel == MENU_CHANNEL)
        {
            llListenRemove(listener);  
            if (message == ">>")
            {
                Dialog(id, MENU2);
            }
            else if (message == "<<")
            {
                Dialog(id, MENU1);
            }        
            else                    
            {
                llGiveInventory(llDetectedKey(0), message);
                llSay(0,"message delivered");
                llRemoveInventory(message);
              
            }      
        }
    }  
}
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2781 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...