Advertisement
RuthvenWillenov

Allowed Drop, Delete Everything but Textures

Mar 9th, 2019
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. default
  2. {
  3.     state_entry()
  4.     {
  5.         llSetText("Drop ONLY TEXTURES here.\n \n All other items will be deleted \nautomatically, and will not be returned",<0.0,1.0,0.0>,1.0);
  6.         llAllowInventoryDrop(TRUE);
  7.     }
  8.  
  9.     changed(integer change)
  10.     {
  11.         if(change &(CHANGED_ALLOWED_DROP|CHANGED_INVENTORY))
  12.         {
  13.             integer num = llGetInventoryNumber(INVENTORY_ALL)-1;
  14.             string myname = llGetScriptName();
  15.             while(num >=0)
  16.             {
  17.                 string name = llGetInventoryName(INVENTORY_ALL,num);
  18.                 integer type = llGetInventoryType(name);
  19.                 if(name != myname && type != INVENTORY_TEXTURE)
  20.                 {
  21.                     llRemoveInventory(name);
  22.                 }
  23.                 num--;
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement