Engine:CLUA script: Difference between revisions

 
(2 intermediate revisions by the same user not shown)
Line 18: Line 18:
script 'var bob fred;bob'
script 'var bob fred;bob'
</lua>
</lua>
Creates a Lua function that sets and prints a variable and runs it from script, all from inside Lua.
Creates a Lua function that sets and prints an engine variable and runs it from script, all from inside Lua.
<lua>
<lua>
function fred(s) script 'bob ' + s + ';bob' end
function fred(s) script 'bob ' + s + ';bob' end
script "lua fred('james')"
script "lua fred 'james'"
</lua>
</lua>
: Prints 'james'
: Prints 'james'