Local vs global variables in Lua
π Luaβ’Updated 2 days agoβ’0 views
By default in Lua all variables are global, so a variable defined in a function without 'local' is accessible anywhere in the chip. Best practice is to keep varβ¦
What is the difference between a local variable and a normal one in Lua/Starfall?
By default in Lua all variables are global, so a variable defined in a function without 'local' is accessible anywhere in the chip. Best practice is to keep variables local unless you explicitly need them global. More info: https://www.l ua.org/pil/4.2.html