Syntax
getinstances(): { Instance }Returns
| Name | Type | Description |
|---|---|---|
instances | { Instance } | Array table of object values copied from the Instance cache table. |
Description
Returns a new array table containing every object value currently stored in the Instance cache. The function takes no arguments. It does not filter by Parent, ClassName, DataModel fieldship, nil-parent state, or Instance validity beyond checking that each registry value is object. Entries are copied into the returned table at sequential numeric indexes starting at 1. The iteration order comes from table iteration over the cache and is not sorted by the function.
Call it without parameters. The function reads the needed context from the current runtime state.
It returns instances ({ Instance }). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = getinstances()
print(result)