While loop not initiating

I made a while loop in a script that loops every 60 seconds (while wait(60) do) and put a print function in the loop but there is no output
image

Yes, there is an end
No, there are not any other wait commands above the while loop.

Any ideas of what might be causing the issue?

It works fine for me, but keep in mind that the wait will happen first. You can think of it like:

while true do
	wait(60)
	print('fired')
end

wait() only works for a conditional as it returns a value after it has finished yielding. Also I would recommend using task.wait() instead.

You’ll likely want to do this:

while true do
	print('fired')
	task.wait(60)
end

Another option is:

repeat
	print('fired')
until not task.wait(60)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.