So, we have our scripts in a pack, but it'd be nice if we could pull out functions, or tables with data, or listeners, and modify them on the fly using exec.lua
. So to do that we need access to those things from external files, i.e they need to be globally accessible. Therefore, we need our mod to put those references into a globally accessible table.
We initialize this global table like this:
MYMOD = MYMOD or {}
this is just shorthand for
if not MYMOD then
MYMOD = {}
end