getcallingscript
Finds the script associated with the current call.
Syntax
Signature
getcallingscript() -> anyAliases
This function has no aliases.
Parameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
any | First non-nil environment script value, normally a script wrapper. |
Notes
Walks the current Lua call stack and returns the first non-nil raw script field found in a Luau closure's environment. Returns nil when no frame supplies one.
Example
Luau
local Result = getcallingscript()
print(Result)