I have a function
function f1(msg) return value end
in Lua file A.lua, how i can call this function or the return result of this function from a B.lua Thank you Jp
You use the require function ( http://www.lua.org/pil/8.1.html )
require("A")
f1("my message")
As a complement to brianm, you can also
dofile("A.lua")
f1("blah")
or
local chunk = assert(loadfile("A.lua"))
chunk()
f1("blah")
require must be without the .lua extension, it isn't possible to load lua files with other extension than .lua. The dofile solution works for any lua file extension.