-- numeric for: start, stop (inclusive), optional step local total = 0 for i = 1, 5 do total = total + i end print(total) -- a negative step counts down for i = 3, 1, -1 do print(i) end
for i = start, stop, step