I'm trying to edit a script that creates a 5 minute timer on TextLabel on a SurfaceGui on a part. The edit I'm making to the script is to make the timer reset.
Here is the original script-
local min = 5
local sec = 0
local mic = 0
while true do
mic = mic - 2
if mic <= -1 then
sec = sec - 1
mic = 59
if sec == -1 then
min = min - 1
sec = 59
if min == -1 then
min = 0
sec = 0
mic = 0
end
end
end
if min <= 9 and sec <= 9 and mic <= 9 then
script.Parent.Text = "0" ..min.. ":0" ..sec..":0" ..mic
elseif min <= 9 and sec <= 9 and mic >= 10 then
script.Parent.Text = "0" ..min.. ":0" ..sec..":" ..mic
elseif min <= 9 and sec >= 10 and mic <= 9 then
script.Parent.Text = "0" ..min.. ":" ..sec..":0" ..mic
elseif min <= 9 and sec >= 10 and mic >= 10 then
script.Parent.Text = "0" ..min.. ":" ..sec..":" ..mic
elseif min >= 10 and sec <= 9 and mic <= 9 then
script.Parent.Text = min.. ":0" ..sec..":0" ..mic
elseif min >= 10 and sec <= 9 and mic >= 10 then
script.Parent.Text = min.. ":0" ..sec..":" ..mic
elseif min >= 10 and sec >= 10 and mic <= 9 then
script.Parent.Text = min.. ":" ..sec..":0" ..mic
elseif min >= 10 and sec >= 10 and mic >= 10 then
script.Parent.Text = min.. ":" ..sec..":" ..mic
end
wait()
end
Here Is the edited script-
local min = 5
local sec = 0
local mic = 0
while true do
while true do
mic = mic - 2
if mic <= -1 then
sec = sec - 1
mic = 59
if sec == -1 then
min = min - 1
sec = 59
if min == -1 then
min = 0
sec = 0
mic = 0
end
end
end
if min <= 9 and sec <= 9 and mic <= 9 then
script.Parent.Text = "0" ..min.. ":0" ..sec..":0" ..mic
elseif min <= 9 and sec <= 9 and mic >= 10 then
script.Parent.Text = "0" ..min.. ":0" ..sec..":" ..mic
elseif min <= 9 and sec >= 10 and mic <= 9 then
script.Parent.Text = "0" ..min.. ":" ..sec..":0" ..mic
elseif min <= 9 and sec >= 10 and mic >= 10 then
script.Parent.Text = "0" ..min.. ":" ..sec..":" ..mic
elseif min >= 10 and sec <= 9 and mic <= 9 then
script.Parent.Text = min.. ":0" ..sec..":0" ..mic
elseif min >= 10 and sec <= 9 and mic >= 10 then
script.Parent.Text = min.. ":0" ..sec..":" ..mic
elseif min >= 10 and sec >= 10 and mic <= 9 then
script.Parent.Text = min.. ":" ..sec..":0" ..mic
elseif min >= 10 and sec >= 10 and mic >= 10 then
script.Parent.Text = min.. ":" ..sec..":" ..mic
end
wait()
end
end
I assumed that adding an extra-
while true do
jsdnjdnajbfhbhjfbahbfhbf
end
I could make the timer repeat but it's not working, can you please help me

1 comment
Thanks