Remove the named inventory item
void llRemoveInventory( string item );
Forced delay: 0.0 seconds. Energy: 10.0.
// Remove the current script from the object
default
{
state_entry()
{
llRemoveInventory(llGetScriptName());
}
}
// user-function to include in your script
// deletes all other contents of any type except the script itself
delete_all_other_contents()
{
string thisScript = llGetScriptName();
string inventoryItemName;
integer index = llGetInventoryNumber(INVENTORY_ALL);
while (index)
{
--index; // (faster than index--;)
inventoryItemName = llGetInventoryName(INVENTORY_ALL, index);
if (inventoryItemName != thisScript)
llRemoveInventory(inventoryItemName);
}
}
default
{
state_entry()
{
delete_all_other_contents();
}
}