Hello, I need to be able to print() and make it so that it will count to 100. I was thinking like
1 | for i = 1 , 100 do |
2 | a = 0 |
3 | a = a + 1 |
4 | print (a) |
5 | end |
but that doesnt work
Thanks for the help!
An example of the output: 1 2 3 4 5 6 7 ... 99 100
It could even go past 100 to infinity, I don't mind. I just need it to infinitely add. Thanks!
Your problem is that every time you run the loop you are setting a back to 0. Instead, do this:
1 | local a = 0 |
2 |
3 | for i = 1 , 100 do |
4 | a = a + 1 |
5 | print (a) |
6 | end |
A pretty easy mistake to make and I'm sure everyone has done this before. Let me know if you have any questions about the difference between the two scripts.
1 | A = 0 |
2 | while true do |
3 | A = A + 1 |
4 | print (A) |
5 | wait( 0 ) -- change the 0 to however long you want the wait to be |
6 | end |