How to make a timer start when a text button is pressed?
Asked by
4 years ago Edited 4 years ago
I am making a game where when a frame pops up asking if you accept the challenge, a timer should start after you hit the button and end once you complete the challenge. Most of the timer scripts I find have the timer starting as soon as the server opens. How do I go about doing this?
The closest thing I've found to what I want to happen is:
local text = script.Parent
local seconds = 59
local minutes = 14
local secondsDisplay = ""
local minutesDisplay = ""
for m = minutes, 0, -1 do
03 | minutesDisplay = "0" ..m |
11 | for s = seconds, 0 , - 1 do |
21 | secondsDisplay = "0" ..s |
29 | text.Text = minutesDisplay.. ":" ..secondsDisplay |
end
The problem is that it starts as soon as the server opens and I need it to wait until the accept button is clicked.