I need to make minutes seconds timer. I used the following code:
01 | local timer = script.Parent |
02 | local minutes = 2 |
03 | local seconds = 19 |
04 |
05 | repeat |
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 ) |
18 | until 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.
Well, I assume it's a Local
script. The easiest way to fix the option of resetting on spawn is :
ScreenGui
and put that script in it, if you don't have one.ScreenGui
and go to its properties.ResetOnSpawn
option, i.e., that option must be set to false.Lemme know if it helps!