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
if m < 10 then
minutesDisplay = "0"..m
else
minutesDisplay = m
end
for s = seconds, 0, -1 do
if seconds > 59 then
s = 59
end
if s < 10 then
secondsDisplay = "0"..s
else
secondsDisplay = s
end
text.Text = minutesDisplay..":"..secondsDisplay
wait(1)
end
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.

1 comment
I would go about using tick(), in my opinion