Don't click here unless you want to be banned.

LSL Wiki : LibraryTextureSwitcher

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
I wrote this code for a client who needed a last minute gift. She asked i post it so here it is :-)
By setting a value to time you can make it shift images every time period.

if you want the image to change by touch remove the comments from the touch_start event. "//"

//From the script library
//Writen by Strife Onizuka
//http://secondlife.com/badgeo/wakka.php?wakka=LibraryTextureSwitcher

float time = 30; //give me a value if you want time based shifting otherwise set to zero

integer total;
integer counter;

next()
{
    string name = llGetInventoryName(INVENTORY_TEXTURE,counter);
    if(name == "")
    {
        total = llGetInventoryNumber(INVENTORY_TEXTURE);
        counter = 0;
        if(total < 1)
            return;
        else
            name = llGetInventoryName(INVENTORY_TEXTURE,counter);
    }
    else if(counter + 1 >= total)
        total = llGetInventoryNumber(INVENTORY_TEXTURE);
    llSetTexture(name ,ALL_SIDES);
    if(total)
        counter = (counter + 1) % total;
}

default
{
    state_entry()
    {
        total = llGetInventoryNumber(INVENTORY_TEXTURE);
        next();
        llSetTimerEvent(time);
    }
//    touch_start(integer a)
//    {
//        llSetTimerEvent(0);
//        next();
//        llSetTimerEvent(time);
//    }
    timer()
    {
        next();
    }
}

ScriptLibrary
There is no comment on this page. [Display comments/form]