Recently, I’ve been working on a game that I left off on 4 years ago. Today, I started on the round script.
The following script is a Script placed in ServerScriptService. When I tested out the script, the TextLabel GUI would only return Intermission: 15 and wouldn’t count down. If anyone knows how I can correct this problem, help is appreciated! (The value of the Status does count down, but the TextLabel doesn’t change.)
local Status = game.ReplicatedStorage.Status
local RoundSystem = game.StarterGui.RoundSystem
for i = 15, 0, -1 do
Status.Value = "Intermission:"..i
RoundSystem.TextLabel.Text = Status.Value
wait(1)
end
You need to access it via player.PlayerGui, not StarterGui.
It’s also generally bad practice to access the PlayerGui on the server, so if your intermission is happening on the server, you should use a remote event to tell all the clients to update their text label, or use an IntValue or similar in some shared location to do that.
local Status = game.ReplicatedStorage.Status
local roundSystems = {}
for _, player in next, game.Players:GetPlayers() do
local RoundSystem = player.PlayerGui.RoundSystem
table.insert(roundSystems, RoundSystem)
end
for i = 15, 0, -1 do
Status.Value = "Intermission:"..i
for i = 1, #roundSystems do
local v = roundSystems[i]
v.TextLabel.Text = Status.Value
end
wait(1)
end
its also better to use a remote event and the countdown to the client