Replace an object's raw metatable (MUTATES live state)
set-rawmetatableReplace a live Roblox object's entire metatable, bypassing __metatable locks, to swap __index or __namecall methods and alter runtime behavior.
Instructions
WRITES LIVE GAME STATE. DANGER — Resolve a Luau expression to an object (table/Instance/userdata) and REPLACE its entire metatable via setrawmetatable, bypassing any __metatable lock. This swaps out __index/__namecall/__newindex etc. wholesale, so it can completely change how the object behaves — overwriting the game's core metatable can break the client, sever security routing, and is a strong anticheat signal. Typical RE use: clone the existing metatable, modify a metamethod, then set it back. Note the target metatable may need to be writable (see set-metatable-readonly) before this succeeds. This changes the live runtime in place. Requires setrawmetatable. Because it mutates state you MUST pass confirm=true; otherwise the tool refuses and does nothing. Returns { Target, ok } or { error }. Signature: { objectPath: string, metatableExpr: string, confirm: boolean, threadContext: number? }. Phase: act; cost=medium; idempotency=idempotent-write. Requires: active-client, resolved-target, explicit-mutation-approval. Capabilities: getrawmetatable. Produces: operation-receipt. Verify with: assert-state. Safety: MUTATING; writes live game/client state. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | Yes | Safety gate. Must be exactly true to apply the change. If omitted or false the tool refuses and does nothing, because replacing a live object's metatable can break the game or trip anticheat. | |
| objectPath | Yes | Luau expression resolving to the object whose metatable you want to replace, e.g. 'game', 'game.Players.LocalPlayer', or 'getgenv().SomeProxy'. Evaluated as `return <objectPath>`. | |
| metatableExpr | Yes | Raw Luau expression evaluating to the NEW metatable (a table) to install, e.g. '{ __index = function() return nil end }', 'setmetatable({}, nil)', or a previously cloned/edited table referenced from getgenv(). Evaluated as `return <metatableExpr>`; must resolve to a table or nil. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |