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.