-- Creates an object that will dynamically add nodes when necessary -- function create_autonomous_object() return setmetatable({}, { __index = index_event }); end -- Index event handler. It will create a new table when it doesn't exist on the autonomous object -- function index_event(tab, key) local newTab = create_autonomous_object(); rawset(tab, key, newTab); return newTab; end -- Create your root autonomous objects here -- component = create_autonomous_object(); params = create_autonomous_object();