Basically, I’ve made a timer work. Right? and so it works fine it goes from 5 minutes and then to 0 and then when the next wave comes it restarts the timer. The Waves are unniversal and save each time the plr resets. However the timer doesnt. It restarts at 5 minutes. Which is quite annoying and im really confused, im trying to make it save however nothing i have tried has worked.
This 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
if seconds < 10 then
timerLabel.Text = minutes..":0"..seconds
else
timerLabel.Text = minutes..":"..seconds
min.Value = minutes
sec.Value = seconds
end
wait(1)
end
end
if timerLabel.Text == "0:00" then
NextWave:FireAllClients()
end
end)
This 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
started is a bool value
plrcount is an Number value which increases when a plr enters and decreases when the player leaves.
Any help is appreciated. Thank you