Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simple Light Bulb with Glow

FireFox Bancroft
Registered User
Join date: 30 Jul 2004
Posts: 134
05-03-2008 22:10
// 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
}
}
}
_____________________
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
05-04-2008 09:02
This could go to scripting library forums.