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.

5 comments
Where is the orange underline located?
What’s the output?
It's under numb and no output. Script just entirely doesn't work.
you cant have multiple loops after each other by the way because the first one will just keep going - also the math.random part shouldnt be erroring at all because it looks correct. Im not sure what you mean by there being an orange line - is it in the script editor or output?
script editor