Lua
Lua Basics
Lua is a small, fast language for writing game scripts, and you'll find it built into Roblox, FiveM and LÖVE.
Start the trackFree, no sign-up needed
What you'll learn
- Your first scriptThe local keyword, print and the .. operator for joining strings
- Numbers and stringsThe //, % and ^ operators and string functions
- ConditionalsOnly nil and false count as false
- LoopsLooping with for, while and repeat, and leaving with break
- Functions and multiple return valuesReturning several values with return and defaults with or
- Any number of argumentsThe three dots ..., select and table.pack
- Closures and function factoriesFunctions that keep their own state
- String patternsThe find, match, gmatch and gsub functions
- Raising and catching errorsRaising with error, catching with pcall, and returning nil with a message
- Scope and localThe local keyword, shadowing and recursion
Track contents
10 lessons, 2 hours in total- 1Your first scriptLuaThe local keyword, print and the .. operator for joining strings8 min
- 2Numbers and stringsLuaThe //, % and ^ operators and string functions13 min
- 3ConditionalsLuaOnly nil and false count as false12 min
- 4LoopsLuaLooping with for, while and repeat, and leaving with break13 min
- 5Functions and multiple return valuesLuaReturning several values with return and defaults with or11 min
- 6Any number of argumentsLuaThe three dots ..., select and table.pack12 min
- 7Closures and function factoriesLuaFunctions that keep their own state13 min
- 8String patternsLuaThe find, match, gmatch and gsub functions14 min
- 9Raising and catching errorsLuaRaising with error, catching with pcall, and returning nil with a message13 min
- 10Scope and localLuaThe local keyword, shadowing and recursion11 min