I made 2 quick programs ot test variable access, I orignally intended to keep this off the forums.
File: variable
local id = idGet function printID() print(type(id).." "..type(idGet)) print(id) end
File: variableTest
idGet = 5
os.loadAPI("variable")
idGet = 7
id = 6
variable.printID()
print(id)
returns "nil nil"returns ""
returns "6" (as expected)
And if you wanna not debug this code just answer this question: Would it return 5 or 7 optimally?
Edited by TYKUHN2, 21 August 2015 - 12:50 AM.











