if i have 2 "for loops" inside each other, and i use "break" in the inner one does it exit from both loops or only the inner one?
break statement only breaks the innermost loop. So even in nested loops, it only breaks the loop the statement is inside of.
This example only breaks the while loop:
for i = 1, 10 do while true do print("hi\n------") break -- while loop broken out of end print(i) end
And you can have as many nested loops as you want, only the innermost loop is broken.