Sure:
Everything defined local can only be used within the area you deifned it
e.g.
Lua Code:
if ... then
local var ...
end
var is only known inside the if!
Same for
loops.
Same for functions
Lua Code:
function thisIsAGlobalFuncKnwonInEveryOtherAddonAndAllYourFiles(param1)
end
local function thisIsALocallFuncKnwonOnlyIntheAreaWhereItIsDefined(param1)
--e.g. inside a file or even inside an if .. then end, or for .. do end
end
https://www.lua.org/pil/4.2.html