Lua
Learn Lua, the lightweight scripting language. Perfect for game development, embedded systems, and extending applications.
Learn Lua — a lightweight scripting language used in games and embedded systems — with concise, beginner-friendly lessons.
Part of the free Lua course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.
New to Lua? No prior experience needed.
Start with Lesson 1 — Introduction to Lua. Whether you want to mod games or build scripts, this course has you covered.
Lessons in this course
- Introduction to Lua — What Lua is, where it's used, and how to run your first Lua script
- Variables and Data Types — nil, booleans, numbers, strings — and how Lua handles types dynamically
- Functions and Tables — Define functions and use Lua's versatile table structure as arrays and objects
- Control Flow and Loops — if/elseif/else, while loops, repeat-until, and numeric for loops
- Metatables and Metamethods — Customise how tables behave with __index, __newindex, and operator overloading
- Lua for Game Development — Apply Lua in game engines like LÖVE2D and Roblox with practical examples
- Strings & Pattern Matching — The string library and Lua's own pattern system — find, match, gmatch, gsub
- OOP with Metatables — Build classes, methods and inheritance using __index and setmetatable
- Coroutines — Cooperative multitasking with create, resume, yield and wrap
- Modules & require — Split code into files that return tables and load them with require
- Error Handling: pcall & error — Lua's protected-call model — pcall, xpcall, error and assert
- Standard Library: io, os & math — Read and write files, work with time and the system, and do math