local

In Lua, variables can be global or local. Unlike global variables, local variables have their scope limited to the block where they are declared.

It is good programming style to use local variables whenever possible. Local variables help you avoid cluttering the global environment with unnecessary names. Moreover, the access to local variables is faster than to global ones.

Usage

local foo = "bar" -- without the word local before it, foo would be global

See Also

Programming in Lua