View Single Post
06-24-18, 07:42 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Variables are values of places in memory, when you create a new local variable inside that function, that is an entirely new memory position the value is stored in.

Every time you run that function the local variable is created anew, and will get the "latest" from the global variable (there's no static variables in Lua).

The only reason you'd want to differentiate the variable naming in a scenario like this is to avoid confusion, nothing more.
  Reply With Quote