llRemoveInventory
function
Function syntax
llRemoveInventory(string item// Name of the item in the prim's inventory to remove.
);- Energy
- 10
Permanently deletes the named inventory item from the prim's inventory.
Remove the named inventory item
llRemoveInventory("");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.
Examples
Section titled “Examples”Example 1
// Remove the current script from the object
default{ state_entry() { llRemoveInventory(llGetScriptName()); }}Example 2
13 collapsed lines
// user-function to include in your script// deletes all other contents of any type except the script itselfdelete_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); }}8 collapsed lines
default{ state_entry() { delete_all_other_contents(); }}Known issues
Section titled “Known issues”From the issue templates included by the wiki article:
- SVC-304 (bug): CHANGED_INVENTORY not triggered by llRemoveInventory()
Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.