I’ve been starting to play around with GUIs a little bit and wanted to create an intermission countdown timer. The timer does update and work correctly on the client, but it does not update on the server.
Local Script in GUI:
local intermissionTime = game:GetService("ReplicatedStorage"):WaitForChild("Variables").intermissionTime
script.Parent.time.Text = intermissionTime.Value
intermissionTime.Changed:Connect(function()
script.Parent.time.Text = intermissionTime.Value
end)
Main Script in ServerScriptService
local intermissionTime = game:GetService("ReplicatedStorage"):WaitForChild("Variables").intermissionTime
game.StarterGui.intermissionGUI.Enabled = true
for i = 15, 0, -1 do
wait(1)
intermissionTime.Value = intermissionTime.Value - 1
if intermissionTime.Value == 0 then
break
end
end
I was wondering if this is bad practice and how to fix it. The code works as intended, but the timer does not update on the server, only the client.