Skip to content

Types and calling conventions ​

Understand Lua values, method calls, indices, and native hashes.

Reference signatures below use documentation notation. Square brackets mean an optional trailing argument; they are not characters to enter in Lua code.

Type or notationMeaning
booleanLua true or false.
integerAn exact Lua integer. Player IDs and list indices have different ranges.
numberA Lua numeric value; APIs that require finite values reject NaN and infinity.
stringLua byte string. Most UI/text APIs allow at most 4,096 bytes and no embedded zero byte.
nilNo value; test optional player results before accessing fields.
function(...)Lua callback; it must return promptly.
math.vec2 / math.vec3Value vectors with writable components, arithmetic, length, distance, dot and normalized-copy methods; global vec2/vec3 aliases remain.
json.nullExplicit JSON null sentinel, retained inside arrays and objects.
MenuPagePage handle returned by menu.root() or page:submenu().
MenuControlControl handle returned by the other page builders.
PointerAn owned-buffer or borrowed-address handle; see the memory reference.
NativeValueOpaque native argument wrapper created by natives.i64() or natives.f32().
RuleIdInteger returned when a script registers an incoming network filter.
→ nothingNo useful return value.
Type[]Dense Lua sequence indexed from 1.

Use dot syntax for namespace functions, for example util.log("Ready"). Use colon syntax for object methods, for example page:button(...) and pointer:read_u32(). Calling an object method with a dot requires explicitly supplying its receiver.

Rockstar IDs are returned as decimal strings to preserve precision. Native hashes are 64-bit identifiers: pass an exact Lua integer or a decimal/0x string where the API accepts one. A floating-point number is not a reliable representation of an arbitrary 64-bit identifier. A named native's Hash argument is a separate, unsigned 32-bit value, commonly produced by util.joaat().