Engine:CCMD lua.lua edit: Difference between revisions

Line 17: Line 17:
While the 'lua' context has the ability to hold variables and aliases, they cannot be created from script as the 'lua' context has no 'alias', 'set' or 'var' type script commands added to the context.
While the 'lua' context has the ability to hold variables and aliases, they cannot be created from script as the 'lua' context has no 'alias', 'set' or 'var' type script commands added to the context.


If the outer scope of the Lua code calls return, the return values will be printed. For example:
If the outer scope of the Lua code calls return, the return values will be printed. For example: <kua>
<kua>a = 1; return 1</kua> Will write '1' to the engine log/console.
context lua
a = 1
return a
</kua> Will write '1' to the engine log/console.


== Examples ==
== Examples ==