I've read every article I could find about the use of the 'local' prefix before declaring a variable and I can understand its usage when present before a variable declared inside a function but is there any use on using said prefix on variables declared at the start of my script?
Like in the following example, does having my 'part' variable be a local one is useful in any way? Or should I just leave it as a global one like 'part2'?
local part = "Part"
part2 = "Part2"
function printParts()
print(part)
print(part2)
end
printParts() -- works fine with both variables

1 comment
I'm not sure if I'm correct, but I remember before that using local variables at the start of your script slightly improves your script's performance. Other than that though, it doesn't really do much.