cache.iscached Synchronous

  • syn.is_cached

Check whether this exact Instance wrapper is the one stored as canonical in the cache. It is useful after cloneref, which deliberately creates another wrapper for the same engine object.

Syntax
Luau
cache.iscached(instance: Instance) -> boolean

Parameters

Function parameters
ParameterTypeDescription
instanceInstanceInstance wrapper to check, rather than merely the underlying engine object.

Returns

boolean

true when this userdata is the current cached wrapper; false for an uncached clone or an invalidated wrapper.

Usage notes

A cache entry for the engine object does not make every wrapper for that object cached.

Example

Example
Luau
local part = Instance.new("Part")
local other = cloneref(part)
print(compareinstances(part, other)) -- true: same engine object
print(cache.iscached(other)) -- false: separate wrapper
part:Destroy()
Kawaii documentation