debug.info
Returns selected function or caller metadata as separate values.
Syntax
debug.info(target: function | number, options: string) -> ...any
debug.info(thread: thread, level: number, options: string) -> ...any
Parameters
| Parameter | Type | Description |
|---|---|---|
thread | thread? | Optional thread for the level overload. |
target | function or number | Function or visible caller level. |
options | string | Requested fields, for example sl or an. |
Returns
| Type | Description |
|---|---|
...any | Selected metadata values in option order. |
Description
Options choose the result fields in order: s for source, l for line, n for name, f for the function, and a for parameter count plus the variadic flag. A thread can precede a numeric level for supported thread inspection. Unlike getinfo, this does not return a metadata table. Apex preserves the game’s ordinary behavior except for explicitly hidden frames. Direct inspection of a replaced Luau function retains its original source, name, declaration line and parameter metadata; execution still uses the replacement.
Example
local function sample(a, b) return a + b end
local count, variadic = debug.info(sample, "a")
print(count, variadic)
These are Game executor contracts. Check build requirements and session lifetimes before using them.
