Reading the reference
Understand signatures, failures, yielding calls, and cleanup.
Read a signature
Signatures describe arguments and results. They are annotations for this reference, not Luau declarations to paste into a script.
| Notation | Meaning |
|---|---|
? | Optional argument or a result that may be nil |
{string} | List of strings |
(string, string) | Two return values in that order |
() | No return values |
Results and errors
nil, false, and a raised error mean different things. A lookup may return nil because nothing matched. A predicate may return false for an ordinary negative result. A call with an invalid argument may raise an error; use pcall when you need to recover from one. Some compilers and file loaders instead return nil plus a reason:
local run, reason = loadstring("this is not Luau")
if not run then
warn(reason)
endRead each function page for its own failure behavior. For example, request returns a response record even when the network operation fails, while httpget returns an empty string for an unsuccessful request.
Calls that yield
An HTTP request, socket connection, decompilation job, file picker, console input, or signal wait can pause the current thread. Do not assume a result exists before that call returns. An error in an event callback or scheduled Actor chunk happens later and is not caught by a pcall around the registration call.
Bytes and object lifetimes
Luau strings can hold binary data, including NUL bytes. Bytecode, image data, compressed blocks, and crypt.random output should be handled as bytes. crypt.hash returns hex text; crypt.hmac returns Base64 text.
Keep a returned connection if you plan to disconnect it. Remove drawings and close sockets when finished. A table or handle may remain in your script after its underlying engine object, VM, or world has gone away; retaining the reference does not revive it.
