Learn Lua
A free, interactive online Lua course. You write Lua on every lesson, with AI hints when something nils out, and a free certificate when you finish.
58,210+ codders enrolled
- Beginner friendly
AI-assisted coding help
Hands-on interactive lessons
Audio narration on every lesson
Quizzes to test your knowledge
Free certificate of completion
Syllabus
Section 1
Fundamentals
Start sectionStartExpandCollapseThe first section in Lua for absolute beginners.Introduction
3 lessons316- 01The LanguageChallenge
- 02Hello World!ChallengeQuiz
- 03CommentsChallengeQuiz
Variables and Data Types
8 lessons754- 01What is a Variable?ChallengeQuiz
- 02NumbersChallengeQuiz
- 03StringsChallengeQuiz
- 04BooleansChallengeQuiz
- 05The Value 'nil'ChallengeQuiz
- 06The type() FunctionChallengeQuiz
- 07Naming ConventionsQuiz
- 08Recap - Character ProfileChallenge
Operators 1 Arithmetic & Conc
6 lessons635- 01Arithmetic OperatorsChallengeQuiz
- 02Modulo OperatorChallengeQuiz
- 03Exponentiation OperatorChallengeQuiz
- 04String ConcatenationChallengeQuiz
- 05Operator PrecedenceChallengeQuiz
- 06Recap - Simple CalculationsChallenge
Operators 2 Relational & Logic
8 lessons651- 01Equality OperatorsChallengeQuiz
- 02Relational OperatorsChallengeQuiz
- 03The 'and' OperatorChallengeQuiz
- 04The 'or' OperatorChallengeQuiz
- 05The 'not' OperatorChallengeQuiz
- 06Short-Circuit EvaluationQuiz
- 07Truthy and Falsy ValuesQuiz
- 08Recap - Simple LogicChallenge
Basic Output
9 lessons954- 01Printing LiteralsChallengeQuiz
- 02Printing VariablesChallengeQuiz
- 03Printing Multiple ValuesChallengeQuiz
- 04Combining Strings & VariablesChallengeQuiz
- 05The tostring() FunctionChallengeQuiz
- 06InputChallengeQuiz
- 07CastChallengeQuiz
- 08Recap - Status ReportChallenge
- 09Recap - Till 120Challenge
Project: Character Stats Disp
Project5 lessons1- 01Welcome MessageChallenge
- 02Declare Character StatsProject
- 03Display Basic StatsProject
- 04Add a Boolean FlagProject
- 05Final SummaryProject
Basic Conditional Logic
4 lessons423- 01The if-then StatementChallengeQuiz
- 02The if-then-else StatementChallengeQuiz
- 03The elseif StatementChallengeQuiz
- 04Recap - Treasure ChestChallenge
String Manipulation Basics
6 lessons637- 01string.len()ChallengeQuiz
- 02string.upper & string.lowerChallengeQuiz
- 03string.sub()ChallengeQuiz
- 04string.rep()ChallengeQuiz
- 05string.find()ChallengeQuiz
- 06Recap - Format UsernameChallenge
Functions Basics
6 lessons636- 01Declaring a FunctionChallengeQuiz
- 02Calling a FunctionChallengeQuiz
- 03Functions with ParametersChallengeQuiz
- 04Functions with Multiple ParamsChallengeQuiz
- 05The 'return' StatementChallengeQuiz
- 06Recap - Area CalculatorChallenge
Tables Part 1: List-Style
8 lessons752- 01What is a Table?Quiz
- 02Creating a TableChallengeQuiz
- 03Accessing Elements by IndexChallengeQuiz
- 04Modifying Elements by IndexChallengeQuiz
- 05The Length Operator '#'ChallengeQuiz
- 06table.insert()ChallengeQuiz
- 07table.remove()ChallengeQuiz
- 08Recap - Manage Party MembersChallenge
Tables 2: Dictionary-Style
7 lessons648- 01Key-Value PairsQuiz
- 02Creating Dictionary-Style TablChallengeQuiz
- 03Accessing - Bracket NotationChallengeQuiz
- 04Accessing with Dot NotationChallengeQuiz
- 05Adding and Modifying PairsChallengeQuiz
- 06Removing Pairs with nilChallengeQuiz
- 07Recap - Item PropertiesChallenge
Loops Basics
6 lessons636- 01The while LoopChallengeQuiz
- 02The repeat-until LoopChallengeQuiz
- 03The Numeric for LoopChallengeQuiz
- 04for Loop with a StepChallengeQuiz
- 05The 'break' StatementChallengeQuiz
- 06Recap - CountdownChallenge
Project: Simple Potion Shop
Project6 lessons1- 01Project SetupChallenge
- 02Adding a PotionProject
- 03Displaying the InventoryProject
- 04Calculating Total Stock ValueProject
- 05Finding a Specific PotionProject
- 06Selling a PotionProject
Variable Scope
5 lessons330- 01Global VariablesQuiz
- 02Local VariablesChallengeQuiz
- 03Why Use Local Variables?Quiz
- 04Scope and BlocksChallengeQuiz
- 05Recap - Scope PuzzleChallenge
Final Challenges
3 lessons3- 01Recap - Player TurnChallenge
- 02Recap - Simple DatabaseChallenge
- 03Recap - Sum of Even NumbersChallenge
Section 2
Logic & Flow
Start sectionStartExpandCollapseDevelop problem-solving skills and create dynamic, interactive programsAdvanced Table Iteration
4 lessons423- 01Iterating with pairs()ChallengeQuiz
- 02Iterating with ipairs()ChallengeQuiz
- 03pairs() vs. ipairs()ChallengeQuiz
- 04Recap - Character SheetChallenge
More Table Library Functions
5 lessons430- 01table.concat()ChallengeQuiz
- 02table construction & unpack()ChallengeQuiz
- 03table.sort()ChallengeQuiz
- 04Custom Sorting with FunctionsQuiz
- 05Recap - High Score BoardChallenge
Advanced Function Concepts
6 lessons539- 01Returning Multiple ValuesQuiz
- 02Variadic Functions (...)ChallengeQuiz
- 03Functions First-Class ValuesChallengeQuiz
- 04Anonymous FunctionsChallengeQuiz
- 05What is a Closure?ChallengeQuiz
- 06Recap - Simple Event HandlerChallenge
Introduction to Metatables
8 lessons757- 01What is a Metatable?Quiz
- 02setmetatable & getmetatableChallengeQuiz
- 03The __index MetamethodChallengeQuiz
- 04The __newindex MetamethodChallengeQuiz
- 05The __tostring MetamethodChallengeQuiz
- 06Arithmetic Metamethods Part 1ChallengeQuiz
- 07Arithmetic Metamethods Part 2ChallengeQuiz
- 08Recap - Read-Only TableChallenge
Project: Text Adventure Engine
Project8 lessons1- 01Project Setup: The RoomChallenge
- 02Linking RoomsProject
- 03Player StateProject
- 04The Game LoopProject
- 05Handling User InputProject
- 06Moving the PlayerProject
- 07Handling Invalid MovesProject
- 08Displaying ExitsProject
Error Handling
3 lessons216- 01The error() FunctionQuiz
- 02Protected Calls with pcall()ChallengeQuiz
- 03Recap - Safe DivisionChallenge
Advanced String Manipulation
6 lessons641- 01string.gsub() for SubstitutionChallengeQuiz
- 02Intro to String PatternsChallengeQuiz
- 03string.find()ChallengeQuiz
- 04string.match()ChallengeQuiz
- 05Iterating with string.gmatch()ChallengeQuiz
- 06Recap - Log File ParserChallenge
Project: Contact List
Project7 lessons1- 01Project SetupChallenge
- 02The Main LoopProject
- 03Adding a ContactProject
- 04Listing All ContactsProject
- 05Searching for a ContactProject
- 06Deleting a ContactProject
- 07Handling Invalid InputProject
Coroutines for Beginners
7 lessons638- 01What is a Coroutine?Quiz
- 02coroutine create & resumeChallengeQuiz
- 03Pausing with coroutine.yield()ChallengeQuiz
- 04resume & yieldChallengeQuiz
- 05Checking Coroutine StatusChallengeQuiz
- 06Recap - Number GeneratorChallenge
- 07Recap - Vector MathChallenge
Section 3
Object Oriented Programming
Start sectionStartExpandCollapseDiscover how to organize code with classes, objects, and reusable structuresThe 'Self' Concept
5 lessons532- 01Tables with FunctionsChallengeQuiz
- 02Explicit 'self'ChallengeQuiz
- 03The Colon SyntaxChallengeQuiz
- 04Dot vs ColonChallengeQuiz
- 05Recap - Moving PointChallenge
Class Prototype Pattern
6 lessons641- 01The Prototype ConceptChallengeQuiz
- 02Linking with __indexChallengeQuiz
- 03The :new() ConstructorChallengeQuiz
- 04Initializing AttributesChallengeQuiz
- 05Independent InstancesChallengeQuiz
- 06Recap - Car FactoryChallenge
Object State and Behavior
7 lessons748- 01Instance VariablesChallengeQuiz
- 02Getter MethodsChallengeQuiz
- 03Setter MethodsChallengeQuiz
- 04Calculated PropertiesChallengeQuiz
- 05Formatting StringsChallengeQuiz
- 06Equality ChecksChallengeQuiz
- 07Recap - Student GradeChallenge
Project: Digital Bank
Project7 lessons1- 01Project SetupChallenge
- 02Deposit MethodProject
- 03Withdraw MethodProject
- 04Get BalanceProject
- 05Account InfoProject
- 06Transfer FundsProject
- 07Final Bank TestProject
Operator Overloading in OOP
5 lessons531- 01Adding ObjectsChallengeQuiz
- 02Subtracting ObjectsChallengeQuiz
- 03Concatenating ObjectsChallengeQuiz
- 04Comparing Objects (<, >)ChallengeQuiz
- 05Recap - Wallet MathChallenge
Inheritance Basics
6 lessons643- 01The Inheritance SetupChallengeQuiz
- 02Inheriting MethodsChallengeQuiz
- 03Extending the ConstructorChallengeQuiz
- 04Adding Child MethodsChallengeQuiz
- 05Shared vs UniqueChallengeQuiz
- 06Recap - Shape HierarchyChallenge
Polymorphism & Overriding
6 lessons640- 01Overriding MethodsChallengeQuiz
- 02Calling Parent MethodsChallengeQuiz
- 03Duck TypingChallengeQuiz
- 04Common InterfaceChallengeQuiz
- 05Checking TypeChallengeQuiz
- 06Recap - Employee RolesChallenge
Encapsulation
6 lessons644- 01Naming ConventionsChallengeQuiz
- 02Closures for PrivacyChallengeQuiz
- 03Access via ClosuresChallengeQuiz
- 04Read-Only TablesChallengeQuiz
- 05Validation LogicChallengeQuiz
- 06Recap - Secure VaultChallenge
Composition & Mixins
6 lessons642- 01Has-A RelationshipChallengeQuiz
- 02DelegationChallengeQuiz
- 03Simple MixinsChallengeQuiz
- 04Applying Multiple MixinsChallengeQuiz
- 05Mixins vs InheritanceChallengeQuiz
- 06Recap - Robot AssemblyChallenge
Project: Shape Manager
Project7 lessons1- 01Project SetupChallenge
- 02Rectangle ClassProject
- 03Circle ClassProject
- 04Perimeter MethodProject
- 05Shape CollectionProject
- 06Total AreaProject
- 07Filter ShapesProject
Design Patterns (Lite)
5 lessons532- 01Factory FunctionsChallengeQuiz
- 02Singleton TableChallengeQuiz
- 03Iterator PatternChallengeQuiz
- 04Observer (Listener)ChallengeQuiz
- 05Recap - Logger FactoryChallenge
Final Challenges
4 lessons4- 01Recap - Inventory SystemChallenge
- 02Recap - User ManagerChallenge
- 03Recap - Score TrackerChallenge
- 04Final OOP CheckChallenge
Lua courses
Hands-on Lua courses, free to start in your browser.
Beginner Challenges - Practice Basic Concepts
PopularPut your beginner coding knowledge to test and try to solve this programming challenges, use any language you want, Happy Coding!
Certificate on completion
- 20
- 20
Coding Problems
PopularPut your programming problem solving skills to the test using the exercises with different difficulties in this course. Designed for coders with some prior knowledge of the basic syntax in any programming language.
Certificate on completion
- 32
- 31
Heaps & Priority Queues - Data Structures Series #7
NewIn this course, you will learn about the Heap data structure (the backbone of priority queues), create a MinHeap from zero using your preferred language, and practice coding challenges with it!
Certificate on completion
- 14
- 6
- 1
Coding Problems: Volume 2
Put your programming problem solving skills to the test using the exercises with different difficulties in this course. Designed for coders with some prior knowledge of the basic syntax in any programming language. This course is an extension of the first Coding Problems
Certificate on completion
- 25
- 24
Star Pattern Bootcamp
Put your programming problem solving skills to learn how to print star patterns range from simple to complex, involving different levels of nested loops, conditional statements, and mathematical calculations.
- 30
- 28
Stack - Data Structures Series #1
In this course, you will learn about the Stack data structure, create a Stack from zero using your preferred language, and practice coding challenges with it!
- 13
- 6
- 1
Why learn Lua with Coddy
- Run real Lua code in your browser. No Lua interpreter to install, no toolchain setup. Each lesson runs your Lua script server-side and shows the output instantly.
- Lua as it's actually used: variables, control flow, functions, tables (Lua's one true data structure), string manipulation, metatables and OOP patterns, error handling. The Lua foundations you need for Roblox, Love2D, or embedded scripting.
- AI hints help you debug Lua scripts and read errors without spoiling the answer, so common stumbles like nil indexing and 1-based arrays become learning moments.
- Free Lua certificate when you finish the course. A credible signal alongside Roblox games, mods, or embedded scripting projects you've built.