Wondering if anyone can help. I have a light script (posted below) its controlled via a remote switch and all works great. However, I would like the light bulb to also switch to full bright when on and switch off when the light is off. I tried to do it myself but just got a massive headache. I'm happy to compensate for the minor adjustment if necessary.
Here is the bulb script:
Code: Select all
//Simple remote light by Adelle Fitzgerald. Use as you like but please keep this header.
integer channel = 20; //Set this to the same channel as your switch. If you want to operate more than one light individually then set to a diffetent channel (not 0) and set the same channel in the switch script
float intensity = 1.0; //Set this to the brightness of the light (0.0 - 1.0)
float radius = 5; //Set this to the light radius in meters (0.0 - 20.0)
float falloff = 2.0; //Set this to the falloff of the light (0.0 - 2.0)
vector colour = <1,1,1>; //colour of the light <R,G,B> (0.0 - 1.0)
default
{
state_entry()
{
llListen(channel,"","","");
}
listen (integer channel, string name, key id, string message)
{
if (message == "on")
{
llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,colour,intensity,radius,falloff]);
}
if (message == "off")
{
llSetPrimitiveParams([PRIM_POINT_LIGHT,FALSE,colour,intensity,radius,falloff]);
}
}
}