Advertisement
Jym_Nova

Give Folder (Unpacker)

Sep 26th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Written By: Ĵyм Ѡҩℓƒ (Jym Resident)
  2. /*
  3. LICENCE:
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. or you may visit - http://license.idjhost.com/
  17. */
  18. // DESCRIPTION
  19. // Give folder of contents on touch
  20.  
  21. default{
  22.     on_rez(integer p){
  23.         llInstantMessage(llGetOwner(), "Touch me to recieve contents.");
  24.         llResetScript();
  25.     }
  26.     touch(integer num_detected){
  27.         if (llDetectedKey(0)==llGetOwner()){
  28.         llInstantMessage(llGetOwner(), "Please wait, gathering information...");
  29.         list inventory = [];
  30.         list INVENTORY_CONSTANTS = [
  31.         INVENTORY_TEXTURE,
  32.         INVENTORY_SOUND,
  33.         INVENTORY_OBJECT,
  34.         INVENTORY_LANDMARK,
  35.         INVENTORY_CLOTHING,
  36.         INVENTORY_NOTECARD,
  37.         INVENTORY_BODYPART];
  38.         integer i;
  39.         integer j;
  40.         integer len = llGetListLength(INVENTORY_CONSTANTS);
  41.         for (i = 0; i < len; i++){
  42.             integer constant = (integer) llList2String(INVENTORY_CONSTANTS, i);
  43.             integer num = llGetInventoryNumber(constant);
  44.             for (j = 0; j < num; j++){
  45.                 string name = llGetInventoryName(constant, j);
  46.                 if (name != llGetScriptName()){
  47.                     inventory += name;
  48.                 }
  49.             }
  50.         }
  51.         string folderName = llGetObjectName() + "'s Contents";
  52.         llGiveInventoryList(llGetOwner(), folderName, inventory);
  53.         llInstantMessage(llGetOwner(), "Look in your inventory for a folder called: "
  54.             + folderName + ". This folder contains your purchased items.");
  55.     }
  56.     else llWhisper(0, "this item does not belong to you.");
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement