Advertisement
Edie_Shoreland

Roz's Thunderdome Gift Box (IT WILL DELETE STUFF)

Mar 28th, 2019
877
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Roz's Thunderdome Gift Box
  2.  
  3. //DON'T USE THIS TO RESELL NO-TRANSFER ITEMS
  4. //THIS ITEM IS NOT FOR GACHA RESELLERS, IT
  5. //WILL DELETE ITEMS FROM THE PRIM INVENTORY
  6. //ONCE IT IS REZZED. THIS IS ONLY FOR FULL
  7. //PERM/COPY&TRANS ITEMS YOU HAVE MADE, HAVE
  8. //SET PERMISSIONS FOR, OR CAN SAFELY KEEP
  9. //BACKUPS OF IN YOUR INVENTORY!
  10.  
  11. //IT WILL DELETE ITEMS IN THE PRIM INVENTORY!
  12.  
  13. //Make sure the script is in the box FIRST!
  14. //Then place your promotional "gacha" items
  15. //inside (along with any promotional textures,
  16. //landmarks, or non-object items).  Once the
  17. //box is rezzed, an item is selected at random
  18. //and all other objects are deleted from the
  19. //box's inventory.
  20.  
  21. //You can set the box for "sale" inworld (as
  22. //long as you don't take it inventory), or
  23. //you can take the box into inventory and send
  24. //it to others, or give it away as a promo
  25. //item for others to rez.  If you accidentally
  26. //"wear" the box while it's in your inventory,
  27. //you'll have to create a new one.
  28.  
  29. //This script can be thwarted in a no-script
  30. //rez area.  Use for promo items, not for
  31. //gacha event type items.
  32.  
  33. default
  34. {
  35.     on_rez(integer start_param)
  36.     {
  37.         string pickOne;
  38.         string rollCall;
  39.         integer howMany;
  40.         integer index;
  41.         howMany = llGetInventoryNumber(INVENTORY_OBJECT);
  42.         pickOne = llGetInventoryName(INVENTORY_OBJECT, (integer)llFrand(howMany));
  43.         for (index=(howMany-1);index>=0;index--)
  44.         {
  45.             rollCall = llGetInventoryName(INVENTORY_OBJECT,index);
  46.             if (rollCall != pickOne)llRemoveInventory(rollCall);
  47.             //THIS DELETES ALL OBJECTS EXCEPT ONE RANDOM OBJECT!
  48.             //Landmarks, textures, and system layer clothing are
  49.             //still safe, though.
  50.         }
  51.         llSetObjectName(pickOne + " (BOXED)" );
  52.         llOwnerSay("This script can be thwarted by opening your box in a no-script parcel");
  53.         llOwnerSay("But I'll bet you already knew that!");
  54.         llRemoveInventory(llGetScriptName()); //Script self deletes.
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement