ReferenceInstances

cache.iscached

Tests whether an Instance has a cached Luau reference.

Syntax

cache.iscached(object: Instance) -> boolean

Also available as

is_cached

Parameters

ParameterTypeDescription
objectInstanceInstance to inspect.

Returns

TypeDescription
booleanWhether a cached reference exists.

Description

The cache stores references, not a list of all living game objects. A false result does not mean the Instance was destroyed. Another engine lookup can repopulate the cache.

Example

local folder = Instance.new("Folder")
print(cache.iscached(folder))
folder:Destroy()

These are Game executor contracts. Check build requirements and session lifetimes before using them.