I'm experimenting with a type of variable/function that is new to me (_G.)
I tried defining a function like this:
_G.function MyFunction()
--code here
end)
However the script editor gave me a red line, so I changed it to this:
_G.MyFunction = function()
--code here
end)
For my future reference, is the second way the correct way to define _G. functions?

2 comments
Thanks!
I would not consider lua OO without classes or structures