I have a a clock gui that counts down, it's unfinished, but this is what I have so far
local seconds = 160
local minutes = math.floor(seconds/60)--Round down
local percentage = seconds%60
local clock = script.Parent.Text
for i = 1, percentage do
wait(1)
sec = percentage-i
print(percentage, i, seconds, percentage-i)
if percentage-i < 10 then
print(1)
clock = "0"..minutes..":0"..sec
else
print(2)
clock = "0"..minutes..":"..sec
end
end
The output after it's done is:
40 1 160 39
2
40 2 160 38
2
40 3 160 37
2
.
.
.
40 37 160 3
1
40 38 160 2
1
40 39 160 1
1
40 40 160 0
1
but the timer is still the same: 0:00 I don't know why it isn't changing, when the if statement is working, everything else inside the if statement seem to be firing, but the code to change the time. Please help me

1 comment
Omg I just realized The script and the output has the same amount of lines! I didn't that on accident!