Syntax
hookmetamethod(object: any, method: string, replacement: function)Arguments
| Name | Type | Description |
|---|---|---|
object | any | Object, table, or drawing value to inspect or change. |
method | string | Namecall method name. |
replacement | function | Replacement value or function that should be installed. |
Description
Hooks a metamethod on a table or object by installing a replacement function.
Call it with 3 parameter(s): object, method, 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
Example call with placeholder values.
hookmetamethod(nil, "example", function() end)