Decreasing "for" loop

I’m somewhat experienced in a couple other languages such as java and c++ and was wondering if the for loop has to count up or if it can only count down

For example in java I would enter:

for (i=20, i>0, i--) {

And it will countdown from 20 to 0, is there anything like that in lua or will I just need to learn how to do it with a while loop?

Thanks in advance.

for I=20,0,-1 do


It’s done like in good (?) old (definitely) C64 BASIC, just without mentioning “STEP”.

for i = 20, 0, -1 do
    -- do something with i

For more guidance:

Besides, I hope you don’t have to “learn” how to use while as a replacement for for.

Or, instead of using I directly, use K and define K as negative I.