Syntax
getscripts(): { Instance }Returns
| Name | Type | Description |
|---|---|---|
scripts | { Instance } | Sequential table of cached LocalScript, ModuleScript, and eligible Script object values from the Instance cache. |
Description
Returns script object values currently present in the Instance cache. The function takes no arguments. It iterates the cache stored under the Instance cache and only considers entries whose value is object. It reads each value's ClassName field with optional string handling. LocalScript and ModuleScript entries are included. Script entries are included only when their RunContext offset equals CLIENT or PLUGIN. Other ClassName values, entries without a string ClassName, and CoreScript entries are skipped. The result is a sequential Luau table. The function does not traverse the DataModel and does not guarantee sorted order.
Call it without parameters. The function reads the needed context from the current runtime state.
It returns scripts ({ Instance }). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = getscripts()
print(result)