Basically, what i want to do is make only one timer, so if another plr joins whilst a round is happening it will still have the same time for him and the other player. I want the timer to be able to carry on at the same time if the players reset or die.
I’ve done this so far, and it carries on the same time when the player resets however when another player joins it flickers between the times.
Here is the server script
OnTimer.OnServerEvent:connect(function(plr, timerLabel)
if wave.Value ~= 6 then
local seconds = 0
local minutes = 5
while true do
seconds = seconds - 1
if seconds == -1 then
minutes = minutes - 1
seconds = 59
end
if minutes == 0 and seconds == 0 then
timerLabel.Text = minutes..":00"
break
end
min.Value = minutes
sec.Value = seconds
wait(1)
end
end
if timerLabel.Text == "0:00" then
NextWave:FireAllClients()
end
end)
Here is the client script
if plrcount.Value >= 1 and started.Value == false then
started.Value = true
OnTimer:FireServer(timerLabel)
start:FireServer(timer.Waiting)
elseif plrcount.Value < 1 then
waiting:FireServer(timer.Waiting)
end
------------------
local function Value(value)
if value < 10 then
timerLabel.Text = min.Value..":0"..value
else
timerLabel.Text = min.Value..":"..value
end
end
Help is always appreciated