Advertisement
Wildflower1112

script for changing one face

Jan 13th, 2023
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //*********************************************************
  2. //                   -Touch Texture Switch-               *
  3. //*********************************************************
  4. // www.lsleditor.org  by Alphons van der Heijden (SL: Alphons Jano)
  5. //Creator: Bobbyb30 Swashbuckler
  6. //Attribution: None required, but it is appreciated.
  7. //Created: December 16, 2009
  8. //Last Modified: March 17, 2010
  9. //License: Public Domain
  10. //Released: Wednesday, December 16, 2009
  11.  
  12. //Status: Fully Working/Production Ready
  13. //Version: 1.0.1
  14. //Disclaimer: These programs are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  15. //            even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16.  
  17.  
  18.  
  19. //Name: Touch Texture Switch.lsl
  20. //Purpose: To change texture on touch
  21. //Description: This script will change the texture on a prim when touched between the two given texture and then sleep.
  22. //Directions: Add script to prim. Change UUIDs in script and save.
  23. //Compatible: Mono & LSL compatible
  24. //Other items required: None
  25. //Notes: Lagless, timerless, Originally written for EternalSailorJupiter Korobase
  26. //     : llSetTexture has a .2 second delay, so there is automatically a .2 second delay built in.
  27. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  28. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  29.  
  30. //global variables you may change
  31. string texture1 = "38717371-a0d5-c262-3098-5a8d47568c13";//UUID of texture 1 (or inventory name if in inventorY)
  32. string texture2= "724646e0-c18a-84fe-f174-77d8435f0988";//UUID of texture2
  33. float time = 0.0;//time to sleep in seconds
  34. integer side = 1;//which side to change texture on
  35.  
  36. /////////////
  37. //don't change below
  38. integer currentstate;//the state its in either TRUE or FALSE
  39. switch(string texture)
  40. {
  41.     llSetTexture(texture, side);
  42.     currentstate = ~currentstate;//swith states
  43.     llSleep(time);
  44. }
  45. default
  46. {
  47.     touch_start(integer total_number)
  48.     {
  49.         if(currentstate)
  50.             switch(texture1);
  51.         else
  52.             switch(texture2);
  53.     }
  54. }
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement