this script i am making is a map and round starter, like those games with lots of minigames. it is a local script parented in playerscripts. here it is:
ready = true
local timer = game.ServerStorage.Time
local msg = game.ServerStorage.MSG
while ready == true do
wait(.1)
game.Players.LocalPlayer.PlayerScripts.LocalScript.Disabled = true
timer.Value = 30
for i = timer.Value,0,-1 do
timer.Value = timer.Value - 1
msg.Value = i.. " Seconds until next match!"
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
wait(1)
end
local chosen = math.random(1,3)
if chosen == 1 then
msg.Value = '"Ice Cold" has been chosen!'
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
wait(1)
msg.Value = "Intermission..."
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
local copy = game.ServerStorage["Ice Cold"]:Clone()
copy.Parent = game.Workspace
wait(5)
local randomspawn = copy.randomspawns:GetChildren()
local spawns = randomspawn[math.random(1,#randomspawn)]
game.Players.LocalPlayer.Character:MoveTo(spawns.Position)
game.Players.LocalPlayer.PlayerScripts.LocalScript.Disabled = false
timer.Value = 60
for v = 4,0,-1 do
for i = 60,0,-1 do
timer.Value = timer.Value - 1
msg.Value = v..":"..i.. "Seconds until match is over!"
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
wait(1)
end
game.ServerStorage.Minute.Value = game.ServerStorage.Minute.Value - 1
end
end
if chosen == 2 then
msg.Value = '"Lava Dungeon" has been chosen!'
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
wait(1)
msg.Value = "Intermission..."
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
local copy = game.ServerStorage.LavaDungeon:Clone()
copy.Parent = game.Workspace
wait(5)
local randomspawn = copy.randomspawns:GetChildren()
local spawns = randomspawn[math.random(1,#randomspawn)]
game.Players.LocalPlayer.Character:MoveTo(spawns.Position)
game.Players.LocalPlayer.PlayerScripts.LocalScript.Disabled = false
timer.Value = 60
for v = 4,0,-1 do
for i = 60,0,-1 do
timer.Value = timer.Value - 1
msg.Value = v..":"..i.. "Seconds until match is over!"
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
wait(1)
end
game.ServerStorage.Minute.Value = game.ServerStorage.Minute.Value - 1
end
end
if chosen == 3 then
msg.Value = '"The Decks" has been chosen!'
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
wait(1)
msg.Value = "Intermission..."
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
local copy = game.ServerStorage["The Decks"]:Clone()
copy.Parent = game.Workspace
wait(5)
local randomspawn = copy.randomspawns:GetChildren()
local spawns = randomspawn[math.random(1,#randomspawn)]
game.Players.LocalPlayer.Character:MoveTo(spawns.Position)
game.Players.LocalPlayer.PlayerScripts.LocalScript.Disabled = false
timer.Value = 60
for v = 4,0,-1 do
for i = 60,0,-1 do
timer.Value = timer.Value - 1
msg.Value = v..":"..i.. "Seconds until match is over!"
game.Players.LocalPlayer.PlayerGui.ScreenGui2.TextLabel.Text = msg.Value
wait(1)
end
game.ServerStorage.Minute.Value = game.ServerStorage.Minute.Value - 1
end
end
end

1 comment
Why are you using a local script for a timer countdown and round starter? You should use a normal script, or else everyone will experience rounds at diffrent times