break
The break statement is used to terminate a loop (while, repeat or for loop) early.
For example:
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
- assignment
- comments
- data types
- do
- for (generic)
- for (numeric)
- function
- identifiers
- if / then / else
- keywords
- local
- logical operators
- precedence
- relational operators
- repeat
- return
- string literals
- tables
- while
Topics
- Lua LPEG library
- Lua PCRE regular expression functions
- Lua SQLite (database) interface
- Lua base functions
- Lua bc (big number) functions
- Lua bit manipulation functions
- Lua coroutine functions
- Lua debug functions
- Lua io functions
- Lua math functions
- Lua os functions
- Lua package functions
- Lua script extensions
- Lua string functions
- Lua syntax
- Lua table functions
- Lua utilities
- Scripting callbacks - plugins
- Scripting