Original Post
I am trying to code a system in which game objects behavior can be dictated by lua scripts. The setup I wanted is where each object has an associated lua file which would look something like this: I've been looking at lots of lua documentation and I know how to get functions from a lua table, however the problem I don't know how to solve is that all the tables would have the same name and would be global, so how would I reference any of them individually, unless there is some way to store them in C code for later use.
OBJECT.OnPickup = function()
{
...
}
OBJECT.OnUse = function()
{
...
}