Timer Countdown Script Not Working

I’m attemping to make a countdown after the player inputs a certain amount of seconds. I’m not sure how to make this work.
Heres the code

`local frame = script.Parent
local box = script.Parent.Input
local button = script.Parent.Submit
local label = script.Parent.Countdown
task.wait(.001)
label.Parent = frame
frame.Visible = true
frame:FindFirstChild(“Countdown”).Visible = false

button.MouseButton1Click:Connect(function()
	--Next few lines = the UI disappearing & the title appearing
	frame.Input.Visible = false
	frame.Submit.Visible = false
	frame.Arrow.Visible = false
	frame.DeveloperTag.Visible = false
	frame.Tip.Visible = false
	frame.Title.Visible = false
	frame.Warning.Visible = false
	frame:FindFirstChild("Countdown").Visible = true
	--Next few lines = the label working
	if not tonumber(box.Text) then return end
	for i = box.Text, 1, -1 do
	label.Text = i
end
end)`

When I run it and input a certain amount of seconds it just shows 1

You don’t wait in the for loop
The for loop does the next cycle in the loop immediately after completing the previous

If you don’t put a task.wait(1) or a wait(1) at the bottom or the top of the loop, it’s just gonna complete every cycle instantaneously

Gotta replace that with

for i = box.Text, 1, -1 do
	label.Text = i
    task.wait(1)
end