Advertisement
Dorex

Untitled

Nov 17th, 2023
1,107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. key stdtexture = "59045e9e-90eb-f715-5f6b-c1c9203d5f5b";
  3. integer front_face   =   3;      //picture face
  4. list    texture_list;    //List of inventory items.
  5. integer texture_total;   //Number of textures.
  6. integer next_pointer; //Next texture number.
  7.  
  8.  
  9. default
  10. {
  11.     state_entry()
  12.     {
  13.         //Count all textures in the inventory.
  14.         integer count = llGetInventoryNumber(INVENTORY_TEXTURE);
  15.         string  texture_name;
  16.         texture_list = [];
  17.  
  18.         if (count > 0){
  19.             //Process the textures into the list.
  20.             while(count--)
  21.             {
  22.                 texture_list += llGetInventoryName(INVENTORY_TEXTURE, count);
  23.             }
  24.    
  25.             //If under 2 textures are found, say an error.
  26.             texture_total = llGetListLength(texture_list);
  27.             if(texture_total > 1)
  28.             {
  29.                 llOwnerSay("Yuo cannot have more than 1 picture!");
  30.                 // llSetTexture(stdtexture, front_face); // if no pictures are in the object we should apply this instweead of giving a script error
  31.                 return;
  32.             }            
  33.         } else {
  34.             //
  35.             // set default texture
  36.             //
  37.             texture_list = (list)stdtexture;
  38.         }
  39.  
  40.  
  41.         //Set the first texture.
  42.         next_pointer = 1;
  43.         llSetTexture(llList2Key(texture_list, 0), front_face);
  44.     }
  45.  
  46.  
  47.     touch_start(integer total_number)
  48.     {
  49.         llSay(0, "Touched.");
  50.     }
  51. }
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement