CODE
// Random XMAS Light script:
//
// This script picks a random color from a list then uses a specialtexture and the
// animation command to make it blink, this metod reduces the load of the server
// since the animations are done client sided.
//
// By White Platini
float time; //blink of the light, must be betwen 1.0 - 2.0
vector light_color; //color of the light.
list colors = [<1,1,1>, <0.16,0.16,0.16>, <1,0,0>, <0,1,0>, <0,0,1>, <114.000000, 178.000000, 66.000000>, <0.917647, 0.917647, 0.000000>, <1.000000, 0.501961, 0.000000>, <0.541176, 0.070588, 0.952941>, <1.000000, 0.576471, 1.000000>, <0.000000, 0.501961, 1.000000>];
default
{
state_entry()
{
//Get a color from the list
light_color = (vector)llList2String(colors, (integer)llFrand(llGetListLength(colors)));
//Get random time
time = (llFrand(10) * 0.10) + 1; //time of the light, must be betwen 1.0 - 2.0
//Set the color on the prim
llSetColor(light_color, ALL_SIDES);
//Sets the special texture
llSetTexture("52a9d11c-b0ce-e5f2-2d5b-475ac2400537", ALL_SIDES);
//Engages the blinking animation
llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES,2,1,0,0,1);
}
on_rez(integer blah)
{
llResetScript();
}
}
Hope it can be useful for everyone.