It Works, It Loads like 7 maps, then The Time (S.Value) Sets to 0, and does nothing, What Am I Doing wrong?
local s = script.Stat
-------------------------------------------------
local f = workspace.FINISH.Fini
--------------inermission-------------------
t = 0
while true do
t= 8
repeat
t= t-1
s.Value = "Next Map Loading in "..t
wait(1)
until t == 0
game.Workspace.Lobby.DROPDOWN.Gate.CFrame = CFrame.new(95, 192.5, -1304)
game.Workspace.Lobby.DROPDOWN.Gate.Transparency = 1
-----------------------------
game.Workspace.Gravity = 20
------------- Maps------------------------
local Maps = {'Yellow','Purple','Sphere','Cylinder','Spike','Rainbow','Lava','Ice','Eagle','YouTube','Sand','Umm','Carpet'}
local randomMap = math.random(1, #Maps)
for i,v in pairs(Maps) do
if randomMap == i then
local storage = game:GetService("ReplicatedStorage")
local map = storage.Maps:WaitForChild(v):clone()
map.Parent = workspace.MapPlaying
if randomMap == 1 then
f.Value = "Yellow Has Been Chosed"
elseif randomMap == 2 then
f.Value = "Purple has Been Chosed"
elseif randomMap == 3 then
f.Value = "Sphere Has Been Chosed"
elseif randomMap == 4 then
f.Value = "Cylinder Has Been Chosed"
elseif randomMap == 5 then
f.Value = "Spike Has Been Chosed"
elseif randomMap == 6 then
f.Value = "Rainbow Has Been Chosed"
elseif randomMap == 7 then
f.Value = "Lava Has Been Chosed"
elseif randomMap == 8 then
f.Value = "Ice Has Been Chosed"
elseif randomMap == 9 then
f.Value = "Eagle Has Been Chosed"
elseif randomMap == 10 then
f.Value = "YouTube Has Been Chosed"
elseif randomMap == 11 then
f.Value = "Sand Has Been Chosed"
elseif randomMap == 12 then
f.Value = "Umm Has Been Chosed"
elseif randomMap == 13 then
f.Value = "Carpet Has Been Chosed"
end
end
end
wait(1)
f.Value = ""
t = 17
repeat
t = t-1
s.Value = t.." Seconds Left To Complete DropDown"
wait(1)
until t == 0
------------- gate
target = CFrame.new(40, 162.06, 70)
for i, player in ipairs(game.Players:GetChildren()) do
player.Character.UpperTorso.CFrame = target
--add an offset of 5 for each character
end
game.Workspace.Lobby.DROPDOWN.Gate.CFrame = CFrame.new(41, 159.5, 21.5)
game.Workspace.Lobby.DROPDOWN.Gate.Transparency = 0
------------
workspace.MapPlaying:ClearAllChildren()
----------------------------
game.Workspace.Gravity = 180
----------------------------
end
s.Value = "Game Ended"
wait(5)

1 comment
please concatenate from the maps table instead of 13 if statements :/