Cache
Manipulate Nexomia's instance reference cache — swap one reference for another, drop cached entries, or test whether an instance is tracked.
The client keeps a cache mapping engine-side instances to the Luau values scripts see. Editing that cache changes what every script in the game gets back for a given instance — including the game's own.
Swapping a reference out
local part = workspace:FindFirstChildWhichIsA("BasePart")
local decoy = part:Clone()
-- Everyone who looks this part up now gets the decoy.
cache.replace(part, decoy)
print(cache.iscached(part))
cache.invalidate(part) -- drop it and let it be re-cached freshThis is global
A cache replacement is not scoped to your script. Every script in the place sees it, which is powerful and easy to regret. cache.invalidate undoes it.