title: How does local variables actuallly work in lua?
body: <p>I know this is very basic question but i'm pretty much confused by the <code>local</code> variables &amp; their scope in lua, for instance if i write <code>local x=12</code>, it means that the variable <code>x</code> is a local variable &amp; it's value is <code>12</code>, but instead if i write <code>local x</code> &amp; in the next line <code>x=12</code>, does this mean the same as in previous case or <code>x=12</code> is treated as a global variable? </p>