Edie_Shoreland

Script Battle Royale

Jan 1st, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Create a bunch of new scripts in inventory, give them cool names like Ultrapocolypse,
  2. // Megarmageddon, and Bob.  Copy this code to each of your recently created scripts,
  3. // rez a box, and dump these scripts inside.
  4.  
  5. // Although theoretically the surviving script should be the one announcing its victory
  6. // You may want to use edit to peek inside the box to see which one actually survived.
  7.  
  8. // Expect to see "Script is missing from database" if you try to open any remaining
  9. // non-survivor scripts in your makeshift arena.  The surviving script will stay intact
  10. // and accessible.
  11.  
  12. // Reward the winning script by saving it in mono and take it back into inventory. It
  13. // will be slaughtered if you leave it in the box.
  14.  
  15. // Edie Shoreland, Evie Moriguchi, and NawtieNitey 2019
  16.  
  17. delete_scripts()
  18. {
  19.     string thisScript = llGetScriptName();
  20.     string inventoryItemName;
  21.     integer index = llGetInventoryNumber(INVENTORY_SCRIPT);
  22.     while (index)
  23.     {
  24.         --index;
  25.         inventoryItemName = llGetInventoryName(INVENTORY_SCRIPT, index);
  26.         if (inventoryItemName != thisScript) llRemoveInventory(inventoryItemName);    
  27.     }
  28. }
  29.  
  30. default
  31. {
  32.     state_entry()
  33.     {
  34.         delete_scripts();
  35.         llSleep (10);
  36.         llSay (0, llGetScriptName() + " is the winner!");
  37.     }
  38.  
  39.     touch_end(integer bye)
  40.     {
  41.         llSay (0, "The arena is closed!");
  42.         //llDie(); //Time to destroy the evidence                  
  43.     }
  44. }
Add Comment
Please, Sign In to add comment