I have this script which gives a countdown to the next round, but after it hits 1 it goess back to 9. How can I get it to stop and pick a random map once the clock hits 0??
-------------------------------------------------------------------------------------------- if game.Workspace.MainText.Value == "MorePlayers" then script.Parent.Text = "You need 2 players to begin the game" script.Parent.Parent.Visible = true elseif game.Workspace.MainText.Value == "GameBegin" then script.Parent.Text = "Next round begins in:" script.Parent.Parent.Visible = true -------------------------------------------------------------------------------------------- for i = 10,1, -1 do script.Parent.Parent.Timer.Text = i wait(1) end end -------------------------------------------------------------------------------------------- game.Workspace.GameBegin.Value = "Begin" --------------------------------------------------------------------------------------------
for i = 10,1, -1 do script.Parent.Parent.Timer.Text = i wait(1) end maps = game.Lighting.Maps:GetChildren() ranmap = math.random(1,#maps) if ranmap == 1 then clonemap = game.Lighting.Maps.Map1:clone() elseif ranmap == 2 then clonemap = game.Lighting.Maps.Map2:clone() end clonemap.Name = "Map" clonemap.Parent = game.Workspace
I think that might work..
all you have to do is use a function instead like this
function choosemap() your script end --then --the loop while true do choosemap() end
i hope that helped