This may sound like a dumb question… it probably is. But, let’s be honest. Most of use have wondered why use local in variables?
Everyone’s seen this phenomenon before. In tutorials and other people’s scripting.
Some use;
x = 1
repeat
x = x + 1
until x == 5
While others do;
local x = 1
repeat
x = x + 1
until x == 5
And it’s completely acceptable. But why?
It’s probably for categorising or ease of readability but other than that what gives? I’ve asked some developers and most don’t even know why. So, might as well clear this one out while we’re here.