Can someone break it down for me? The wiki is confusing for me and I don't understand it's purpose and what it does. Can anyone help? Thank you!
✓ ANSWER ACCEPTED
What is a metatable?
2 answers
✓ Accepted answer
Go here, I found it very useful for better understanding metatables.
To explain metatables to a beginner, I would say it's a table within a table that manages the table.
local t = {"pizza", "pie"}
local mt = {__index = function(t, i, v)
return "ice"
end}
setmetatable(t, mt)
Basically what this code will return "ice" if you try to index a nil value inside table "t".
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Could be a comment..