Texture Changer

Date 2006/10/13 5:20:15 | Topic: Texture

Drop up to 10 different textures into an object and this script. It will change to the next texture automatically.

It will change textures in the order that they appear in the object's contents, (alphabetical,) so rename them to choose the order.

Currently it will change the texture on all sides. For just one side change "ALL_SIDES" whenver it appears to the side number you want. llSetTexture(name, 1) for example.

integer number;
string name;
integer choice 0;

default
{
    
state_entry()
    {
        
llSetTimerEvent(2.5); //How many seconds inbetween textures
        
number llGetInventoryNumber(INVENTORY_TEXTURE);
    }
    
timer()
    {
        if (
choice number)
        {
            
name llGetInventoryName(INVENTORY_TEXTUREchoice);
            if (
name != "")
            
llSetTexture(nameALL_SIDES);
            
choice choice 1;
        }
        else
        {
            
name llGetInventoryName(INVENTORY_TEXTUREchoice);
            if (
name != "")
            
llSetTexture(nameALL_SIDES);
            
choice 0;
        }
    }
    
changed(integer change)
    {
        if (
change CHANGED_INVENTORY
        {
            
llResetScript();
        }
    }
}




This script comes from Alicia Stella Design - Best Tip Jars in Second Life
http://www.aliciastella.com

The URL for this script is:
http://www.aliciastella.com/modules/AMS/article.php?storyid=4