Why not combining both scripts if this is needed for a street lamp or something? :smileyhappy:
float sun_height;vector sun_position;default{ state_entry() { llSetTimerEvent(150); } timer() { sun_position = llGetSunDirection(); sun_height = sun_position.z; if(sun_height < 0.0) { llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,<1.0, 1.0, 1.0>,1.0,15,0.750, PRIM_GLOW, ALL_SIDES, 0.4]); } else { llSetPrimitiveParams([PRIM_POINT_LIGHT,FALSE,<1.0, 1.0, 1.0>,1.0,15,0.750, PRIM_GLOW, ALL_SIDES, 0.0]); } }}
Or add a random timer to it to simulate a broken flourecent light...:smileysurprised:
float glow;float time;//-------------------------------------// Main programdefault{ state_entry() { llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES); state begin; }}//-------------------------------------// Begin statestate begin { state_entry() { glow = (integer) llRound(llFrand(1)); // Random on or off time = (float) llFrand(2); // Random wait time llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0, 1.0, 1.0>, glow, 5.0, 0.5, PRIM_GLOW, ALL_SIDES, glow]); // Set prim light on/of state wait; // Go to the Wait State } }//-------------------------------------// Wait statestate wait { state_entry() { llSetTimerEvent(time); //Wait } timer() { llSetTimerEvent(0.0); //remove the timer state begin; // Go back to the Begin State } }
Have fun!