#This has nothing to do with Roblox Studio but I still need help anyways

1 messages · Page 1 of 1 (latest)

shadow ibex
#

Hey so I don't really know how to solve this bug that kept bugging me all day, I asked ai, it didn't help, I asked other people, but THEIR information didn't help either this code is pretty hard to solve ngl.

tight oar
#

So what exactly is the problem?

dapper dew
#
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