Skip to content

Metatable library

Eskue edited this page Jan 2, 2025 · 3 revisions

The metatable library provides functionality for manipulating, detouring and retrieving metatables.


getrawmetatable(obj: any): {any} get_raw_metatable fflags.bool_metatable_manipulation

Returns a proxy for manipulating and reading obj's metatable

hookmetamethod(obj: any, method: string, hook: function): function fflags.bool_metatable_manipulation

Attempts to hook obj's metamethod method using hook. Returns the original metamethod.

isreadonly(obj: {any} | userdata): boolean is_readonly is_read_only

Returns wheter or not obj is able to be written to.

setreadonly(obj: {any} | userdata, value: boolean) set_readonly set_read_only

Un/locks obj's properties via metatables based on value.

makewritable(obj: {any} | userdata) make_writable

Locks obj's properties via metatable.

getproperties(obj: Instance): {string} get_properties

Retrieves all instance properties of obj.

Clone this wiki locally