cache.replace
Replaces an instance's cached wrapper.
Syntax
Signature
cache.replace(Instance: Instance, Replacement: function) -> ()Aliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Instance | Instance | Instance reference to inspect. |
Replacement | function | Function used instead of the target. |
Returns
| Type | Description |
|---|---|
() | None. |
Notes
Both arguments must be instance wrappers. This changes future cache lookups and does not replace a scene object. The native cache must be available and writable.
Example
Luau
local Players = game:GetService("Players")
cache.replace(Players, cloneref(Players))
print(cache.iscached(Players))