✓ Accepted answer
I would use a NumberValue in ReplicatedStorage that acts as the timer. For every second that passes, you can change its Value from a server script, and listen to the .Changed of the value from the local scripts to update the gui. This way, when a player joins, their script will pick up the change and update their gui to be synced with the others.
For example, if there was a NumberValue called Timer in ReplicatedStorage, you could do this in a server script:
local Timer = 1
while true do
game.ReplicatedStorage.Timer.Value = Timer
Timer = Timer + 1
wait(1)
end
And in a LocalScript inside the gui:
game.ReplicatedStorage.Timer.Changed:Connect(function(NewVal)
script.Parent.Text = "time passed: " .. NewVal
end)
Which should keep all clients up-to-date, regardless of when they join.
2 comments
Thanks! It does not let me to accept your answer for some odd reason..
nvm