llRemoveInventory
void llRemoveInventory(string InventoryItem)Remove the named inventory item.
Remove the named inventory item from the object inventory.
Parameters
-
InventoryItem(string)
Remove the current script from the object:
default{ state_entry() { llRemoveInventory(llGetScriptName()); }}Delete 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(); }}Caveats
Section titled “Caveats”- If the current script is removed it will continue to run for a short period of time after this call.
- With multiple executions an
llSleep(0.1)afterllRemoveInventorywill allow edit window contents to refresh correctly and avoid errors on phantom contents. llRemoveInventorywill not trigger a changed event.