Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key stdtexture = "59045e9e-90eb-f715-5f6b-c1c9203d5f5b";
- integer front_face = 3; //picture face
- list texture_list; //List of inventory items.
- integer texture_total; //Number of textures.
- integer next_pointer; //Next texture number.
- default
- {
- state_entry()
- {
- //Count all textures in the inventory.
- integer count = llGetInventoryNumber(INVENTORY_TEXTURE);
- string texture_name;
- texture_list = [];
- if (count > 0){
- //Process the textures into the list.
- while(count--)
- {
- texture_list += llGetInventoryName(INVENTORY_TEXTURE, count);
- }
- //If under 2 textures are found, say an error.
- texture_total = llGetListLength(texture_list);
- if(texture_total > 1)
- {
- llOwnerSay("Yuo cannot have more than 1 picture!");
- // llSetTexture(stdtexture, front_face); // if no pictures are in the object we should apply this instweead of giving a script error
- return;
- }
- } else {
- //
- // set default texture
- //
- texture_list = (list)stdtexture;
- }
- //Set the first texture.
- next_pointer = 1;
- llSetTexture(llList2Key(texture_list, 0), front_face);
- }
- touch_start(integer total_number)
- {
- llSay(0, "Touched.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement