How do I stop the same map from being chosen twice?
I have made an effort to try and figure it out and I can't. I'm hoping someone will be able to help me else I'll be stuck on this problem for awhile.
Here is the code. Does anyone have any suggestions to stop it from choosing the same map twice in a row?
02 | local mapChoice = math.random( 1 , 3 ) |
03 | if mapChoice = = 1 then |
04 | print ( "Map 1 got chosen!" ) |
05 | local map = game.ServerStorage.Maps.Map 1 :clone() |
06 | map.Parent = game.Workspace |
07 | map:MoveTo(Vector 3. new( 100 , 100 , 100 )) |
09 | elseif mapChoice = = 2 then |
10 | print ( "Map 2 got chosen!" ) |
11 | local map = game.ServerStorage.Maps.Map 2 :clone() |
12 | map.Parent = game.Workspace |
13 | map:MoveTo(Vector 3. new( 100 , 100 , 100 )) |
15 | elseif mapChoice = = 3 then |
16 | print ( "Map 3 got chosen!" ) |
17 | local map = game.ServerStorage.Maps.Map 3 :clone() |
18 | map.Parent = game.Workspace |
19 | map:MoveTo(Vector 3. new( 100 , 100 , 100 )) |