Hi, I’m quite new to scripting, and was wanting to test math.random(). I made a basic script to see if it would randomly load a map. And it looks like this:
local randmap = math.random(1,2)
wait(15)
if randmap == 1 then
Game.Workspace.Map1.Transparency = 1
Game.Workspace.Map1.CanCollide = true
print("map1 was chosen")
end
if randmap == 2 then
Game.Workspace.Map2.Transparency = 1
Game.Workspace.Map2.CanCollide = true
print("map2 was chosen")
end
Yet, when i test the game, both Map1 and Map2 just disappear from the workspace, I’m not really sure why this happens, so can someone explain it to me, maybe I am just using math,random() incorrectly.
My workspace looks like this:
Thanks.