Unless the entry you're referring to in the addon table is another table, you'll just get a copy of the value, not a link to the entry. This is just how Lua stores tables and other complex value types as opposed to the basic types (numbers, strings, boolean, and nil).
To further explain this, I'll break down how Lua process something like this:
- Lua sees the name MyAddOnTable and finds it as a table in the list of registered locals.
- Lua finds the indexing operator "." and expects the following text to be an index.
- Lua sees MyVar and looks at the table entry which that string index points to.
What this means is
MyVar isn't a variable in the way we usually see one. It's a table entry while
MyAddOnTable is the actual variable in the statement.