Skip to content

Instantly share code, notes, and snippets.

@benphelps
Created June 9, 2013 01:03
Show Gist options
  • Save benphelps/5737167 to your computer and use it in GitHub Desktop.
Save benphelps/5737167 to your computer and use it in GitHub Desktop.
local _table = {
target = {
health = (function()return 20 end)
},
player = {
health = (function()return 20 end)
},
}
local table = {
}
local meta = {
__index = function(t, k)
return _table[k]
end;
__call = function(t, ...)
return t[select(1, ...)]
end;
}
setmetatable(table,meta)
print(table.target.health)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment