Hello,
I want to make a simple counter in the output which will increase every second.
Here is my code but it doesn't seem to work as I expected:
while true do
wait(1)
print'1'
end
Help will be appreciated.
Hello,
I want to make a simple counter in the output which will increase every second.
Here is my code but it doesn't seem to work as I expected:
while true do
wait(1)
print'1'
end
Help will be appreciated.
Hello,
What you need to use is a for loop.
Here is the code:
for i = 1, 10 do --change ten with the max counter number
wait(1)
print(i)
end
Frag
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Your code will just print the number '1' forever in the output.
Thank's it helped, I assume that if I change the wait() rate,the number between prints will change.
Yeah, you can also change the max number of the counter (see comment).