How to make contruction script to easily create multiple lights?

Thanks but I tried doing that, but I still kept getting it wrong. If there was an image showing this, that would make it very clear.