How would you spawn object in a straight line

Tried using an array but it isn’t very consistent - http://prntscr.com/bfex87
The script - http://prntscr.com/bfexu9