Hello! I'm making a game where the players need to be teleported to a map after the script chooses the map. The problem is when I run the game, absolutely nothing happens. How would I go about fixing this? Thanks for stopping by! Here is the script:
local Map1 = game.lighting.Map1
local Map2 = game.lighting.Map2
local Map3 = game.lighting.Map3
function ChooseMap()
while true do
wait(5)
ChooseMap = math.random(1,3)
if ChooseMap == 1 then
game.lighting.Map1:Clone(game.workspace)
for _, plr in pairs(Game:GetService("Players"):GetPlayers()) do
if plr.Character then
plr.Character:MoveTo(Vector3.new(14.31, 1.61, -151.635))
wait(10)
Map1:Destroy()
end
if ChooseMap == 2 then
game.lighting.Map2:Clone(game.workspace)
for _, plr in pairs(Game:GetService("Players"):GetPlayers()) do
if plr.Character then
plr.Character:MoveTo(Vector3.new(23.1, 38.74, 117.9))
wait(10)
Map2:Destroy()
end
if ChooseMap == 3 then
game.lighting.Map3:Clone(game.workspace)
for _, plr in pairs(Game:GetService("Players"):GetPlayers()) do
if plr.Character then
plr.Character:MoveTo(Vector3.new(23.1, 72.26, 117.9))
wait(10)
Map3:Destroy()
wait(10)
end
end
end
end
end
end
end
end
end
