So I am trying to add different gamemodes to my game by using a math.random then teleport script. However, when I look at the script, my value is not working. It is underlined orange. What is wrong here?
while wait(math.random(3,5)) do local numb = math.random(1,2) print(numb) end while true do wait(1) seconds.Value = seconds.Value - 1 if seconds.Value == 0 and ingame == 0 and numb == 1 then ingame = 1 seconds.Value = 90 local teleport = game.Players:GetChildren() for i = 1, #teleport do teleport[i].Character:MoveTo(Vector3.new(Game.X, Game.Y, Game.Z)) if seconds.Value == 0 and ingame == 0 and numb == 2 then ingame = 1 seconds.Value = 90 local teleport = game.Players:GetChildren() for i = 1, #teleport do teleport[i].Character:MoveTo(Vector3.new(Game2.X, Game2.Y, Game2.Z)) end end end end end
I would also like to say that due to me being terrible at scripting, most of this is from a tutorial video.