I've tried everything. I just can not get a timer to work without it only working for the player, and resetting every time they die. I need one for the game, because my whole game will revolve around a central round timer and when it ends. Any ideas? Here is the code that I borrowed from a youtuber, and I've tried modifying it to work for all players but it only works for a single player.
clockTimerThing = game.ReplicatedStorage:WaitForChild("ClockTimerThing")
if clockTimerThing.Value == 0 then
repeat wait(0.1) until clockTimerThing.Value > 0
end
TimeInSeconds = clockTimerThing.Value
TimeInMinutes = math.floor(TimeInSeconds/60)
remainder = TimeInSeconds % 60
for i,v in pairs(game.Players:GetChildren()) do
print('1')
end
clockText = v.PlayerGui.ScreenGui.Clock
for i = 1, remainder do
if TimeInMinutes > 9 then
if remainder - i < 10 then
clockText.Text = TimeInMinutes..":0"..remainder - i
else
clockText.Text = TimeInMinutes..":"..remainder - i
end
else
if remainder - i < 10 then
clockText.Text = "0"..TimeInMinutes..":0"..remainder - i
else
clockText.Text = "0"..TimeInMinutes..":"..remainder - i
end
end
end
for i = 1, TimeInMinutes do
TimeInMinutes = TimeInMinutes - 1
for i = 1, 60 do
wait(1)
if TimeInMinutes > 9 then
if 60 - i < 10 then
clockText.Text = TimeInMinutes..":".."0"..(60-i)
else
clockText.Text = TimeInMinutes..":"..(60-i)
end
else
if 60 - i < 10 then
clockText.Text = "0"..TimeInMinutes..":0"..(60-i)
else
clockText.Text = "0"..TimeInMinutes..":"..(60-i)
end
end
end
end

2 comments
Could you put everything in a code block please
Okay I did