For i = num1,num2 loop not working second time in a modulescript function

Hello.
I have made a modulescript that runs a timer. For whatever reason, the loop that runs the timer does not start a second time.

Code
function data:CountDown()
     for i = 1, 30 do
     game.ReplicatedStorage.TimerValue.Value = game.ReplicatedStorage.TimerValue.Value - 1
    end
end

I really cannot find why the function would not run a second time. In my real script, a warning is used to see when the function runs, and it does when asked to. The loop dosen’t though. The only thing that happens is the warning appears.

Thanks for any help in advance.

I think we need more info. Like, how is the module function being called?

It is being called by another function inside the module script. I have tried calling the function from a Normal script on the server side but it does the same thing.

You need to add a wait in your code. Also, there is a better way to do this.
Try this instead:

function data:CountDown()
	for i = 30, 0, -1 do
		game.ReplicatedStorage.TimerValue.Value = i
		wait(1)
	end
end

The wait is already there. I just forgot to write it in the post. Your loop still didn’t run the second time. Yet the warning still happened.

I changed where the function was, from a module to a server script and it works fine.