Give All Inventory Except For the Script
Page 1 of 1
Give All Inventory Except For the Script
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 ));
}
}
}
}
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum