Rainbow Color Changer

Expired

// Place in contents of a prim. Touch to start or stop

integer ON = FALSE;
integer loop;
float x;
default
{
    touch_start(integer total_number)
    {
        llSetTimerEvent(0.5*(ON = !ON));
        loop = 1;
        x = 0;
    }

    timer()
    {
        if(loop == 1)
        {
            llSetColor(<1 ,0.2*x,0>,ALL_SIDES);
            x = x+0.25;
            if (x > 5)
            {
                loop = 2;
                x = 5;
            }
        }
        else if (loop ==2)
        {
            llSetColor(<0.2*x,1,0>,ALL_SIDES);
            x = x-0.25;
            if(x <0)
            {
                loop = 3;
                x = 1;
            }
        }
        else if (loop == 3)
        {
            llSetColor(<0,1.0-(0.2*x),0.2*x>,ALL_SIDES);
            x = x+0.25;
            if(x > 5)
            {
                loop = 4;
                x = 5;
            }
        }
        else if (loop == 4)
        {
            llSetColor(<1 .0-(0.2*x),0,1>,ALL_SIDES);
            x = x-0.25;
            if(x <0)
            {
                loop = 5;
                x = 1;
            }
        }
        else if (loop == 5)
        {
            llSetColor(<1,0,1.0-(0.2*x)>,ALL_SIDES);
            x = x+0.25;
            if (x > 5)
            {
                loop = 1;
                x = 0;
            }
        }
    }
}

 

Quick Change Color Changer

Expired

From Hank Ramos on the LSL script forum: Here is an extremely laggy version, but cool looking..

 

default
{
    state_entry()
    {
        while (TRUE)
        {
            llSetColor(, ALL_SIDES);
        }
    }
}

 

Color change Script with Timer

Expired

vector FIRST_COLOR = <1 .0,0.0,0.0>;
vector SECOND_COLOR = <0.0,1.0,0.0>;

float TIMER_INTERVAL = 1.0;

default {
   state_entry() {
      //
      //   all states will hear this timer until one of them
      //   stops it using llSetTimerEvent( 0.0 )
      //
      llSetTimerEvent( TIMER_INTERVAL );
      //
      // start the color cycle
      //
      state first_color;
   }
}

state first_color {
     state_entry() {
        llSetColor( FIRST_COLOR, ALL_SIDES );
     }

     timer() {
        state second_color;
     }
}

state second_color {
     state_entry() {
        llSetColor( SECOND_COLOR, ALL_SIDES );
     }

     timer() { 
        state first_color;
     }
}

 

Simple Color Change Script with timer

Expired

vector COLOR_1 = <1 .0,0.0,0.0>;   // Pure red
vector COLOR_2 = <0.0,1.0,0.0>;  //  Pure green

integer USE_COLOR_1;

default {
   state_entry() { 
      USE_COLOR_1 = FALSE;
      llSetTimerEvent( 1.0 );
   }

   timer() {
       if (USE_COLOR_1) 
          llSetColor( COLOR_1, ALL_SIDES );
       else 
          llSetColor( COLOR_2, ALL_SIDES );

        USE_COLOR_1 = !USE_COLOR_1;
       }
   }
}