Why isn't the if statement working on line 19?
local timeint = 57 local inttime = 5 local gametill = 5 local status = game.ReplicatedStorage.Status if game.ServerScriptService.PlayerCount.Players.Value>=2 then for i = inttime,1,-1 do wait(1) status.Value = "Intermission: "..i.." seconds." end for i = gametill,1,-1 do status.Value = "Game starts in "..i.." seconds!" wait(1) end status.Value = "Capture the enemy's flag!" wait(3) for i = timeint,1,-1 do status.Value = "Game Time: "..i.." seconds." if status.Value ~= "Game Time: "..i.." seconds." then wait(10) end wait(1) end else status.Value = "Waiting for more players to join." end
There's a different text that comes up and the gui doesn't wait 10 seconds.
It probably does, just at the wrong times. This only checks once, and does not if another player joins. This has a simple fix. Use this.
local timeint = 57 local inttime = 5 local gametill = 5 local status = game.ReplicatedStorage.Status game.Players.PlayerAdded:Connect(function() if #game.Players:GetPlayers() >= 2 then --Use your useful roblox functions, man. for i = inttime,1,-1 do wait(1) status.Value = "Intermission: "..i.." seconds." end for i = gametill,1,-1 do status.Value = "Game starts in "..i.." seconds!" wait(1) end status.Value = "Capture the enemy's flag!" wait(3) for i = timeint,1,-1 do status.Value = "Game Time: "..i.." seconds." if status.Value ~= "Game Time: "..i.." seconds." then wait(10) end wait(1) end else status.Value = "Waiting for more players to join." end end)
Hope this helps!