I have two files, the first is toLoad.lua which contains;
function psomething(s)
print(s)
end
The second is loadRun.lua which contains;
local ps = require("toLoad")
ps.psomething("hello")
Executing loadRun.lua results in;
> dofile("loadRun.lua")
loadRun.lua:3: attempt to index a boolean value
stack traceback:
loadRun.lua:3: in main chunk
[C]: in function 'dofile'
stdin:1: in main chunk