Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help making a minutes seconds timer?

Asked by 4 years ago

I need to make minutes seconds timer. I used the following code:

01local timer = script.Parent
02local minutes = 2
03local seconds = 19
04 
05repeat
06    if seconds <= 0 then
07        minutes = minutes - 1
08        seconds = 59
09    else
10        seconds = seconds - 1
11    end
12    if seconds <= 9  then
13        timer.Text = tostring(minutes)..":0"..tostring(seconds)
14    else
15        timer.Text = tostring(minutes)..":"..tostring(seconds)
16    end
17    wait(1)
18until minutes <= 0 and seconds <= 0

It worked but my timer resets when players resets his character. I need to make a timer when player resets his character or die it should not reset the timer.

Please help me.

1 answer

Log in to vote
1
Answered by 4 years ago

Well, I assume it's a Local script. The easiest way to fix the option of resetting on spawn is :

  1. Add a ScreenGui and put that script in it, if you don't have one.
  2. Click on your ScreenGui and go to its properties.
  3. Unselect ResetOnSpawn option, i.e., that option must be set to false.

Lemme know if it helps!

0
game:GetService("StarterGui").ResetPlayerGuiOnSpawn = false This does not work. Toxicheroking77 -8 — 4y
0
It did not solved my issue. Toxicheroking77 -8 — 4y
0
They removed that ^ hes telling you to press on the ScreenGui its self and mark the "ResetOnSpawn" PROPERTY to false. then it will solve your problem AntoninFearless 622 — 4y
0
I will try and tell Toxicheroking77 -8 — 4y
0
It helped me. Toxicheroking77 -8 — 4y
Ad

Answer this question