Skip to content
Saiko

cache.replace

Replaces the cache entry of one instance with another instance. Afterwards the first reference no longer compares equal to the second, nor to a fresh reference to the second instance.

Signature

luau
cache.replace(instance: Instance, with: Instance): ()

Parameters

instanceInstance

The instance whose cache entry is replaced.

withInstance

The instance that takes its place.

Returns

Nothing.

Note

Example

luau
local a = game:GetService("BadgeService")
local b = game:GetService("Stats")

cache.replace(a, b)

print(a == b) --> false
print(a == game:GetService("Stats")) --> false