Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Cycle thru textures in inventory on touch
- // @author: JB Kraft
- // ------------------------------------------------------------------------
- // counter
- integer g_NDX = 0;
- // ------------------------------------------------------------------------
- // D E F A U L T
- // ------------------------------------------------------------------------
- default
- {
- // --------------------------------------------------------------------
- touch_start(integer total_number)
- {
- // get the number of texture in inventory
- integer count = llGetInventoryNumber( INVENTORY_TEXTURE );
- // if there are none, do nothing
- if( count == 0 )
- return;
- // if we are past the last one, set th the first one
- if( g_NDX > count - 1 )
- g_NDX = 0;
- // set the texture
- llSetTexture( llGetInventoryName(INVENTORY_TEXTURE, g_NDX), ALL_SIDES);
- // increase the count
- ++g_NDX;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement