lua function(...) code example
Example 1: lua function
--// Basic Function
function PrintingText()
print("My text here")
end
PrintingText()
Example 2: lua parameters function
--// LUA basic function parameter
function BasicParameter(text)
print(text)
end
BasicParameter("My Text Here")
Example 3: 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 4: What is lua used for
Lua is a powerful and fast programming language that is easy to
learn and use and to embed into your application.
Lua is designed to be a lightweight embeddable scripting language.
It is used for all sorts of applications,
from games to web applications and image processing.
--
Used commonly in Roblox, Garry's Mod and Multi Theft Auto
Example 5: Function script in lua
local function GoodFunction() --Replace GoodFunction Wiht Your Function Name
--Your Script Here
end
GoodFunction() --Replace GoodFunction Wiht Your Function Name
Example 6: lua function syntax
function name (parameters)
--code
end