Advertisement
Madi_Perth

Untitled

Nov 5th, 2023
1,079
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Linden Scripting 0.64 KB | Source Code | 0 0
  1. // user-function to include in your script
  2. // deletes all other contents of any type except the script itself
  3. delete_all_other_contents()
  4. {
  5.     string thisScript = "name of notecard not to delete";
  6.     string inventoryItemName;
  7.  
  8.     integer index = llGetInventoryNumber(INVENTORY_NOTECARD);
  9.     while (index)
  10.     {
  11.         --index;        // (faster than index--;)
  12.  
  13.         inventoryItemName = llGetInventoryName(INVENTORY_NOTECARD, index);
  14.  
  15.         if (inventoryItemName != thisScript)  
  16.             llRemoveInventory(inventoryItemName);    
  17.     }
  18. }
  19.  
  20. default
  21. {
  22.     state_entry()
  23.     {
  24.         delete_all_other_contents();
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement