Scripts

getscriptclosure

Returns the callable closure associated with a script instance.

Syntax

getscriptclosure(script: userdata): function
Aliases getscriptfunction

Arguments

NameTypeDescription
scriptuserdataScript or ModuleScript instance to inspect.

Returns

NameTypeDescription
closurefunctionCreated closure function.

Description

Returns the callable closure associated with a script instance.

Call it with 1 parameter(s): script. The argument table explains which values are required and which ones only refine the behavior.

It returns closure (function). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = getscriptclosure(game)
print(result)