Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is the point of __index metamethod?

Asked by 3 years ago
Edited 3 years ago

im new to learning object coding and im getting confused of why there is a __index metamethod even tho you could instead:

local table = {
a = 1
b = 2
}

if not table.c then
-- Put code you would have kept in __index metamethod
else
print("continued the script without using a function :)")
end

Answer this question