Skip to content

Global Functions

function type(obj: any): string
function tonumber(s: string, base: number?): number?
function tostring(obj: any): string
function print(args: ...any)
function assert<T>(value: T, message: string?): T
function error(obj: any, level: number?)
function getmetatable(obj: any): table?
function setmetatable(t: table, mt: table?)
function pcall(f: function, args: ...any): (boolean, ...any)
function xpcall(f: function, e: function, args: ...any): (boolean, ...any)
function newproxy(mt: boolean?): userdata
function rawget<K, V>(t: { [K]: V }, k: K): V?
function rawset<K, V>(t: { [K] : V }, k: K, v: V)
function rawlen<K, V>(t: { [K]: V } | string): number
function rawequal(a: any, b: any): boolean
function next<K, V>(t: { [K]: V }, i: K?): (K, V)?
function select<T>(i: string, args: ...T): number
function select<T>(i: number, args: ...T): ...T
function ipairs(t: table): <iterator>
function pairs(t: table): <iterator>
function unpack<V>(a: {V}, f: number?, t: number?): ...V

Equivalent to table.unpack

function gcinfo(): number
function getfenv(target: (function | number)?): table
function setfenv(target: function | number, env: table)