Color change Script with Timer

Written by Kitsune
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;
     }
}