I recommend so you create a string value inside of replicated storage and change this value by a script. Then all you have to script on the client is that you have to read this value once changed and it’s going to update based on server’s increase or decrease.
set the textlabel’s text in the starter gui and then fire to all clients and have a script in the gui listen for the clientevent and have it update the textlabel’s text for them.
You can use this code to change the counter value:
function StartCounter()
local CounterString = game.ServerStorage.Counter
local Counter = 10 * 60 --10 Minutes
spawn(function()
while wait(1) do
Counter = Counter - 1
CounterString.Value = string.format("%d:%02d", math.floor(Counter/60), Counter%60)
--Fire all clients to change the counter UI or something idk...
if (Counter <= 0) then
break -- End the loop and wait till the next call
end
end
end)
end
Basically, everytime the round starts, call StartCounter() and the counter will start to change, everytime It changes, replicate It across all clients.
%d:%02d is a String Pattern that you can use for formating the raw counter value to a “time” format. I picked It up from a post I found on the devforum and if I’m not wrong, %d returns any type of number that we input after the string.
Basically the first %d is equal to the second parameter of string.format, math.floor(Counter/60), and the second %02d" is equal to Counter%60.