Fantasy of Life
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Give All Inventory Except For the Script

Go down

Give All Inventory Except For the Script Empty Give All Inventory Except For the Script

Post  nabrej_Aabye Tue Mar 17, 2009 12:28 am

This script you put in a box give everything except the script that makes it give everything

Code:
list give_in_folder;
list give_individually;
integer item_no;
string name;
integer folder_give = FALSE;
integer item_give = FALSE;

get_inv_details()
{
    name = llGetInventoryName( INVENTORY_ALL, item_no );
    if ( name != llGetScriptName() )
    {
        integer mask = llGetInventoryPermMask(name, MASK_OWNER);
        if ( (mask & PERM_COPY) )
        {
            give_in_folder = give_in_folder + [ name ];
            folder_give = TRUE;
        }
        else
        {
            give_individually = give_individually + [ name ];
            item_give = TRUE;
        }
    }
}
init()
{
//    Hovertext, edit accordingly - commented out right now,using separate script
//    llSetText( "Meta's Freebies\nRight Click, Touch & Gimmee\n to Get contents in a folder",<1,1,1>,1);

    llSetTouchText("Gimmee");
    llOwnerSay (" Touch to receive contents");
}
default
{
state_entry()
{
    init();
}
on_rez( integer param)
{
    init();
}
touch_start( integer num )
{
///////////////////////////////////////////////////////////////////
//  if ( llDetectedKey(0) != llGetOwner() )                      // uncomment these lines
//  {                                                            // to allow only the owner
//      llOwnerSay ("only the owner can empty this box");        // to get the contents
//      return;                                                  // of the box
//  }                                                            //
///////////////////////////////////////////////////////////////////
    item_no = 0;
    for ( item_no= 0 ; item_no < llGetInventoryNumber( INVENTORY_ALL ) ;item_no++ )
    {
        get_inv_details();
    }
    if ( folder_give )
    {
        llGiveInventoryList ( llDetectedKey(0), llGetObjectName(), give_in_folder );
    }
    if ( item_give )
    {
        integer i;
        for ( i=0 ; i<llGetListLength( give_individually ) ; i++ )
        {
            llGiveInventory( llDetectedKey(0),llList2String( give_individually, i ));
        }
    }
}
}
nabrej_Aabye
nabrej_Aabye
Admin

Number of posts : 6
Registration date : 2009-03-16

https://fantasylife.darkbb.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum