Me being lazy didn’t want to write out all arguments in my onClientEvent… so I did what any irrational person would do and put … in the brackets.
And when trying to encapsulate “…” into a table {} like this → {…}, essentially I construct a new table with the arguments. This makes it easier for me to access the specific argument I want. However, this caused an issue, while the keys were intact, when trying to access a key via table[key], the values were returned nil.
So what I did was setting a metatable onto the table with the index metamethod to return self[key] hopefully returning the value. This over caused a C Stack overflow ;/
Since you set the __index metamethod, the line return self[key] is invoking the metamethod from within it, since this goes on forever you see a stack overflow.
Instead you should use rawget(table, index) so the metamethod doesn’t invoke itself.
Taking a step back, metatables aren’t required here, your problem likely arises from either a misjudgement of indices or from not accounting for the player argument etc. Metatables won’t help.
Edit: I went through the concerned parts of the script since they’re shown here (missed that!), the problem is you’re assuming that variable names affect the keys of the table, this is not the case. The client recieves only the values associated with the variables and packs them in a list-like table, which means the indices/keys are numerical. An example:
-- Server
...
local a, b, c = "foo", 7, "bar"
event:FireClient(player, a, b, c)
...