A module simply exports variables to a global module
.
If your module includes other modules, make sure you include them before exporting.
/scripts/shapes.lua
local shapes = {}
function shapes.circle(...)
-- Do stuff.
end
-- This statement will export the contents of 'shapes' as a module.
module = shapes
require "/scripts/include.lua"
-- Local reference to module
local shapes = include("/scripts/shapes.lua")
--- shapes.circle(...)
-- Global reference to module
include("/scripts/dyes.lua", "dyes")
--- dyes.red