Volt

makewritable

Makes a table writable.

Syntax

makewritable(table: table) -> void

Parameters

ParameterTypeDescription
tabletableThe 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

On this page