How can you stop this timer

so i this line of code that’s a timer, but how can you stop it i don’t want to disable the script and i don’t want to destroy the script too, i just want to end the timer, is it possible?

this is the script

	for i = game.ServerStorage:FindFirstChild("Value").Value,0,-1  do
		game.ServerStorage.Value2.Value = i
		wait(1)
	end
1 Like

If you introduced a condition to it as a debounce you could break the loop. Here’s an example, I’ll put a BoolValue parented to this script. If you run the code and manually change the bool to True you’ll see it discontinues the loop and outputs it’s broken. When the loop reaches the “break” line it won’t execute any further, so the lines outside of that conditional statement don’t happen.

local debounce = script.debounce

for i = 10, 0, -1  do
	if debounce.Value then
		print("break!")
		break
	end

	print(i)
	task.wait(1)
end
1 Like

ohhh okay thanks for the information

1 Like