So What is happening is that the main script in the serverscriptservice fires an event to all clients when the client script gets the message, a function starts counting down the time. But my problem is, when you die or reset, the timer gui disappears(its invisible by default) and resets to how it was set in studio. How can I work around this?
LocalScript:
RoundLength = 120 game.ReplicatedStorage.length.Value = RoundLength game.ReplicatedStorage.TimerEvent:FireAllClients(RoundLength) wait(RoundLength)
ClientScript:
Time = script.Parent game.ReplicatedStorage:WaitForChild("TimerEvent").OnClientEvent:connect(function(RoundLength) if Time.Text ~= "0" then for i = RoundLength, 1 ,-1 do Time.Visible = true wait(1) Time.Text = i end elseif Time.Text == "0" then Time.Visible = false end end)
Here's an idea - When the Player respawns, send the event again to that specific Player, but set the RoundLength to the current round time. Not tracking that on the server? Now's your time to start.