So I’m trying to make it so that you lose then you have to wait lets say 15 minutes but if you leave the timer has to continue instead off just leaving and joining, but all those tutorials make a new datastore but I already have 1 so please help me!
Heres my script:
gameOverFrame.Visible = true
local gameOverTime = math.floor(chanceNumber / 500)
if gameOverTime < 60 then
while gameOverTime >= 0 do
gameOverTimeText.Text = gameOverTime.." remaining"
gameOverTime -= 1
wait(1)
end
elseif gameOverTime / 60 < 60 then
while gameOverTime >= 0 do
local minutes = math.floor(gameOverTime / 60)
local seconds = math.floor(gameOverTime - minutes * 60)
gameOverTimeText.Text = minutes..":"..seconds.." remaining"
gameOverTime -= 1
wait(1)
end
elseif gameOverTime / 60 / 60 < 60 then
while gameOverTime >= 0 do
local hours = math.floor(gameOverTime / 60 / 60)
local minutes = math.floor(gameOverTime - hours * 60)
local seconds = math.floor(gameOverTime - minutes * 60 - hours * 60 * 60)
gameOverTimeText.Text = hours..":"..minutes..":"..seconds.." remaining"
gameOverTime -= 1
wait(1)
end
end
gameOverFrame.Visible = false