How to make contruction script to easily create multiple lights?

Here is very rough example, but i think its enough to understand how it works.