Syntax
cache.replace(instance: Instance, replacement: Instance)Arguments
| Name | Type | Description |
|---|---|---|
instance | Instance | Instance whose Instance cache entry should be replaced. |
replacement | Instance | Instance value to store in the cache entry for the first argument. |
Description
Sets the cached Instance entry for one Instance to another Instance.
Call it with 2 parameter(s): instance, replacement. The argument table explains which values are required and which ones only refine the behavior.
It does not return data. Treat the call as an action and handle errors around the call site when needed.
Example
Store one Instance as the cached entry for another Instance.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
cache.replace(Players, ReplicatedStorage)
print(cache.iscached(Players))