makewritable
Makes a table writable.
Syntax
makewritable(table: table) -> voidParameters
| Parameter | Type | Description |
|---|---|---|
table | table | The table to make writable |
Returns
This function does not return a value.
Description
makewritable removes the read-only flag from a table, allowing modifications.
Example
local mt = getrawmetatable(game)
-- Make writable for modifications
makewritable(mt)
-- Now we can modify it
local oldIndex = mt.__index
mt.__index = newcclosure(function(self, key)
return oldIndex(self, key)
end)
-- Lock it again
makereadonly(mt)Notes
- Equivalent to
setreadonly(table, false) - Always re-lock metatables after modification
Related Functions
makereadonly- Make table read-onlysetreadonly- Set read-only statusisreadonly- Check read-only status