Local: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
A local varible only exists within the function it is specified. Therefore, it exists between "on function" and the functions "end" point.
A local variable only exists within the function it is specified. Therefore, it exists between "on function" and the functions "end" point.


Example:
Example:
<syntaxhighlight lang="lua">local playermoney = getPlayerMoney ( source )</syntaxhighlight>
<syntaxhighlight lang="lua">local playermoney = getPlayerMoney ( source )</syntaxhighlight>

Revision as of 21:13, 22 September 2006

A local variable only exists within the function it is specified. Therefore, it exists between "on function" and the functions "end" point.

Example:

local playermoney = getPlayerMoney ( source )