Lua 5.4 Reference — Simplified
Based on the official Lua 5.4 Reference Manual. Simplified for quick lookup. Examples included.
Table of Contents
| # | Topic | Covers |
|---|---|---|
| 1 | Types & Values | nil, boolean, number, string, function, userdata, thread, table |
| 2 | Variables, Scopes & Environments | local, global, _ENV, upvalues |
| 3 | Operators & Expressions | arithmetic, bitwise, relational, logical, concat, precedence |
| 4 | Statements & Control Flow | if, for, while, repeat, goto, break, return |
| 5 | Functions & Closures | definitions, varargs, closures, first-class functions |
| 6 | Tables | creation, sequences, arrays, records, mixed tables |
| 7 | Metatables & Metamethods | __index, __newindex, __add, __gc, __mode, proxy tables |
| 8 | Coroutines | create, resume, yield, wrap, status |
| 9 | Error Handling | pcall, xpcall, error(), assert, protected calls |
| 10 | Garbage Collection | incremental, generational, finalizers, weak tables |
| 11 | Standard Library | string, table, math, os, io, debug, coroutine, utf8, package |
Quick Facts
- Lua 5.4LuaA lightweight, embeddable scripting language used as the primary scripting language in FiveM server development. released June 2020
- Integers: 64-bit signed (default), Floats: double-precision (default)
- One data structure: tables (associative arrays)
- Garbage collected: incremental or generational modes
- Embeddable: clean C API, ~30K lines of C
- Reserved words:
and break do else elseif end false for function goto if in local nil not or repeat return then true until while