// Author: FireFox Bancroft
// Permissions: Free to copy, give away, sell. Please leave these two lines in-tact.
integer on;
default
{
state_entry()
{
llPassTouches(TRUE); // touching any part of the object
// passes touch command to our root prim.
}
touch_start(integer total_number) // this is a touch light, you turn it on and off by touch.
{
if(on)
{
on = FALSE;
llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 1, 1>, 0, 10.0, 0]); // Light is off.
// [PRIM_POINT_LIGHT, TRUE/FALSE, vector color, float intensity,
// float radius, float falloff]
// <R,G,B> vector can be changed for different colors.
// We just change the intensity to 0 to make it appear off.
llSetPrimitiveParams([25, ALL_SIDES, 0.0]);
// Toggles glow off
// [PRIM_GLOW, Integer Face, Intensity]
// 25 is the value for PRIM_GLOW. see
// http://lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParams
}
else
{
on = TRUE;
llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 1, 1>, 1.0, 7.0, 0]); // Light is on.
llSetPrimitiveParams([25, ALL_SIDES, 1.0]); // Toggles glow on
}
}
}
