#This has nothing to do with Roblox Studio but I still need help anyways
1 messages · Page 1 of 1 (latest)
So what exactly is the problem?
local example = setmetatable({Name = "Mathew"}, {__index = function(self, key)
return key == "greetings" and self.Name or nil
end})
print(example.greetings)
this has no issue
as a reference, though, not as a fix for your exact circumstances
I don't know why you set table to a new table, and especially before putting it in the one scenario that would make sense (the key == "greetings") which would really still not make sense because you could just use a default string or the table you passed in, but 🤷
also, please note that table is a standard Lua library, so you are recommended (not required) to use another variable name
what is the problem exactly?