Ah, here’s another test. It looks like if I don’t place local in front of a variable in main.lua, it will become global.
main.lua
[lua]local module01 = require (“module01”)
myVar = 0;
print(“calling module01.myFunction() in main.lua while myVar is still 0”)
module01.myFunction() – prints value of myVar inside myFunction = 0
myVar = 1234;
print(“calling module01.myFunction() in main.lua after myVar is set to 1234”)
module01.myFunction() – prints value of myVar inside myFunction = 1234[/lua]
module01.lua
[lua]module(…, package.seeall) – removing package.seeall causes error
function myFunction() – placing local in front of the function causes error
print("value of myVar inside myFunction = " … tostring(myVar))
end[/lua] [import]uid: 67217 topic_id: 17717 reply_id: 67872[/import]