Title.
Here is my code:
01 | local TweenService = game:GetService( "TweenService" ) |
02 | local RS = game:GetService( "ReplicatedStorage" ) |
03 |
04 | local enemiesFolder = RS.Enemies |
05 | local enemySpawn = workspace.EnemySpawns:GetChildren() |
06 | local moveToParts = workspace.MoveToParts:GetChildren() |
07 |
08 | local randomSpawn = enemySpawn [ math.random( 1 , #enemySpawn) ] |
09 | local randomMoveToPart = moveToParts [ math.random( 1 , #moveToParts) ] |
10 |
11 | local function Round 1 () |
12 |
13 | local Round 1 Enemy = enemiesFolder.Enemy 1 :Clone() |
14 | Round 1 Enemy.Parent = workspace.Enemies |
15 | local currentPivot = randomSpawn:GetPivot() |
Round1() has its own while wait() do loop. When you run Round1() on line 27 it will continue forever because the loop on lines 17 to 21 will never stop.