Hay developers, I am trying to make a script that loads 3 random obbys based on a math.random(1,3)
The thing is once it reaches the first if statement that matches the random number. It stops the scripts and only loads that one obby. So im stuck with a 1 stage obby when im wanting 3 to be loaded at once. The script can be found bellow. Any help is awesome! Thank you!
local ST = game.Lighting.SelfTraining
local RanNum1 = math.random(1,3)
local RanNum2 = math.random(1,3)
local RanNum3 = math.random(1,3)
if RanNum1 == 1 then
ST.Platform1O1.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum1 == 2 then
ST.Platform1O2.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum1 == 3 then
ST.Platform1O3.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum2 == 1 then
ST.Platform2O1.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum2 == 2 then
ST.Platform2O2.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum2 == 3 then
ST.Platform2O3.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum3 == 1 then
ST.Platform3O1.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum3 == 2 then
ST.Platform3O2.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end
if RanNum3 == 3 then
ST.Platform3O3.Parent = workspace
wait(60)
ST.Platform1O1.Parent = game.Lighting.SelfTraining
end