Puppet box Roblox remake

Hi developers. So im try to remake puppet music box from FNAF 2. But idk how to do this correctly, first idea which come to my head is make timer with loop for which counting for example 100 sec and if player holding button then loop stop where he stop counting and going in reverse to 100.

[What do you want to achieve?]
I want to remakepuppet music box system like in FNAF 2. When we must keep puppet asleep with winding her box to prevent the waking her and kill us.
[What is the issue?]
Currently my friend help me to make script

local prompt = script.Parent.ProximityPrompt
local text = script.Parent.SurfaceGui.Timer
local status = script.Parent.Status.Value

function WindUp()
	status = "up"
	prompt.ActionText = "Wind down"
		text.Text +=1
	until text.Text == "20" or status == "down"

function WindDown()
	status = "down"
	prompt.ActionText = "WindUp"
		text.Text -=1
	until text.Text == "0" or status == "up"

	if status == "up" then
	elseif status == "down" then

[What solutions have you tried so far?]
At the beginning of i was make two loops which one is counting 100 sec.(before i ask my friend to help me make script).And if player holding some button then loop stoped and second start counting instead of first one.
Above code is working almost right but it still buggy. Can someone help do this more correctly.
There in a part my code

1 Like

I know the Forgotten memories have this system. So i want to make too.

If I read it right, you click once to start winding up, and once again to wind down, like a toggle. Isn’t the point of the puppet box to need to be held down?

Yeah but I was mention this above.