There's no lag on my end but I have an advanced card. The discussion on how to use this is here including the code:

http://www.coniserver.net/ubbthreads/sho...true#Post749477

The action in that post is just for the fading code. The actual light code is not there, but that's basic enough. Here's my dynamic light script. It perhaps contains a lot of crap not needed by everyone, but I use all of it for one reason or another.

Code:

// uses: localKillSwitch, lightBroken, castToggle, beginOn, startDelay, distToggle, alwaysOn, minDist, maxDist
// uses: randomColorRange, redColor, blink, randBlink, shortDelay, longDelay, range, rangeModifier, lightningOn
action light2
{
while(!player) { wait(1); }
var tempShortDelay; var tempLongDelay;
my.passable = on;
if(my.castToggle == on)
{
my.cast = on;
}
else
{
my.cast = off;
}
if(my.beginOn == on) //light object is turned on
{
if(my.startDelay > 0) //delay before turning on
{
wait(-my.startDelay);
}
my.invisible = off;
}
else
{
my.invisible = on; //light object begins turned off
}

my.skill11 = 100 * pow(my.minDist, 4) / (pow(my.maxDist, 2) - pow(my.minDist, 2)) + 100 * pow(my.minDist, 2);
my.skill12 = -100 * pow(my.minDist, 2) /( pow(my.maxDist, 2) - pow(my.minDist, 2));

while(1)
{
if(globalKillSwitch == 0 && my.localKillSwitch == 0)
{
if(my.beginOn == on) //light object is turned on
{
if(-my.startDelay > 0) //delay before turning on
{
wait(my.startDelay);
}
my.invisible = off;
}
else
{
my.invisible = on; //light object begins turned off
}
if((vec_dist(player.x, my.x) < my.distToggle && my.alwaysOn == off) || my.alwaysOn == on) //light remains on while player is closer than my.skill3
{
if(my.randomColorRange == on) //random color and range
{
my.lightrange = max(random(my.range), my.range/my.rangeModifier); //make sure rangeModifier > 0
if(my.lightrange == 0) { my.lightrange = 1; }
my.red = int(random(my.redColor));
if(my.red == 0) { my.red = 1; }
}
else //constant color and range
{
my.lightrange = my.range;
my.red = my.redColor;
}
my.green = my.red;
my.blue = my.red;
if(my.blink == on) //blink on
{
if(my.randBlink == on) //random blinking
{
tempShortDelay = random(my.shortDelay);
if(tempShortDelay == 0) { tempShortDelay = 0.1; }
wait(-tempShortDelay); //short delay
my.lightrange = 0;
if(my.beginOn == on) //turn object off
{
my.invisible = on;
}
tempLongDelay = random(my.longDelay);
if(tempLongDelay == 0) { tempLongDelay = 0.1; }
wait(-(tempShortDelay + tempLongDelay)); //long delay
my.invisible = off; //turn object back on
}
else //constant blinking
{
wait(-my.shortDelay); //short delay
my.lightrange = 0;
if(my.beginOn == on)
{
my.invisible = on; //turn object off
}

wait(-my.longDelay); //long delay
//my.startDelay = 0;
my.invisible = off; //turn object back on
}
}
if(my.lightningOn == on && dynBool == 1)
{
my.lightrange = 0;
}

mat_shadow.alpha = my.skill11 / (clamp(vec_dist(my.x,player.x), my.minDist, my.maxDist) * clamp(vec_dist(my.x, player.x),my.minDist,my.maxDist)) + my.skill12;
}
else //out of range...light off
{
my.lightrange = 0;
my.invisible = on;
}
}
else
{
my.lightrange = 0;
if(my.lightBroken == on)
{
//ent_morph(my, "whatever");
//break;
}
else
{
my.invisible = on;
}
}
wait(1);
}
}




My User Contributions master list - my initial post links are down but scroll down page to find list to active links