Try this: -- module.lua local m = { } -- This is local, since it's stored into `m` (which is a local itself). function m.do_something(foo, bar) return foo + bar end return m -- init.lua package.path = package.path .. ";" .. minetest.get_modpath("yourmodname").."/?.lua"...