function arguments lua code example

Example 1: lua parameters function

--// LUA basic function parameter

function BasicParameter(text)
print(text)
end

BasicParameter("My Text Here")

Example 2: lua functions

function myFunction()	-- Start with 'function', give it a name
  -- Do something amazing...
end		-- Finish with 'end'

myFunction()	-- Call the function later in the code

Example 3: lua command line arguments

-- Display the command line parameters
print(arg[0])    -- Name of the script
print(arg[1])    -- First parameter
print(arg[2])    -- Second parameter

Tags:

Lua Example