In my file, there is a variable called enemyTime. It is increased by one each time and when it reaches enemyLimit variable, it makes enemy come at random spots on the stage. But for some reason it increases by 1, then goes back to 0 resulting in no enemies on stage. For detailed info, please look at the file attached.
I know that the problem is probably something stupid. So, I am sorry if I wasted your time.