Metatables

setreadonly

Changes the readonly state of a table or metatable.

Syntax

setreadonly(target: table, value: boolean)

Arguments

NameTypeDescription
targettableTarget function, table, stack level, or object being inspected or changed.
valuebooleanNew value to write.

Description

Changes the readonly state of a table or metatable.

Call it with 2 parameter(s): target, value. 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.

setreadonly({}, true)