break

The break statement is used to terminate a loop (while, repeat or for loop) early.

For example:
while true do
  if mob_in_room () then
    break
  end -- if
end -- while
Also see the return statement which is used to leave the current function (not just the current loop).

Lua keyword/topics

Topics