How do loops work?

I will change that right now, thanks

EDIT: I changed the ForLoopWithBreak to a ForLoop, set the first index as 0, last as 2 and generated one system in a random position in the first sector. I will try more things