Why does my script continuously spawn maps?
01 | if #contestants > = 2 then |
02 | print ( "Enough players detected! Starting game soon." ) |
05 | print ( "Not enough players." ) |
11 | mapholder:ClearAllChildren() |
13 | local allmaps = maps:GetChildren() |
14 | local newmap = allmaps [ math.random( 1 ,#allmaps) ] |
15 | newmap.Parent = game.Workspace |
All variables are defined, don't worry about that. I'm not getting any errors, either. It just keeps spawning more than one map even after I have broken out of the loop to go to the next section of code.
What is the problem?
Please explain your answer.
Help is vital.