--main.lua
for o = 1, 5 do
print(o)
SampleFunction()
end
--in B.lua
function SampleFunction()
print(o) --prints nil
end
I have a for loop, which is iterating over a range. Inside that for loop, I am calling a function which is in some other Lua file and I need the iterator variable to be accessible in the other Lua file, but it just prints NIL every time, what do I need to do?