mytable = setmetatable({key1 = "value1"}, { __index = function(mytable, key) if key == "key2" then return "metatablevalue" else return mytable[key] end end }) print(mytable.key1,mytable.key2)
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more