Advertisement
Guest User

LSL Texture Cycler

a guest
Jun 24th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. // Cycle thru textures in inventory on touch
  2. // @author: JB Kraft
  3. // ------------------------------------------------------------------------
  4.  
  5. // counter
  6. integer g_NDX = 0;
  7.  
  8. // ------------------------------------------------------------------------
  9. // D E F A U L T
  10. // ------------------------------------------------------------------------
  11. default
  12. {
  13. // --------------------------------------------------------------------
  14. touch_start(integer total_number)
  15. {
  16. // get the number of texture in inventory
  17. integer count = llGetInventoryNumber( INVENTORY_TEXTURE );
  18. // if there are none, do nothing
  19. if( count == 0 )
  20. return;
  21. // if we are past the last one, set th the first one
  22. if( g_NDX > count - 1 )
  23. g_NDX = 0;
  24. // set the texture
  25. llSetTexture( llGetInventoryName(INVENTORY_TEXTURE, g_NDX), ALL_SIDES);
  26. // increase the count
  27. ++g_NDX;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement