Lua Tutorial

Get the Cheat Sheet Here :
Best Lua Book :

Support me on Patreon :

Data Types 3:43
Math 6:58
Conditionals 10:53
Ternary Operator 15:20
Strings 16:35
Looping 19:11
Repeat Until 20:44
User Input 20:56
For 22:00
For In 22:29
Tables 23:41
Functions 28:26
Return Multiple Values 29:25
Variadic Functions 33:13
Closure 34:27
Coroutines 36:46
File I/O 40:10
Modules 43:32
Metatables 45:30
OOP 51:00
Inheritance 55:04


Aaron Parr says:

Thanks for the great tutorial!
One minor issue @~32:42: The extra ‘nil’ value printed is because at the very end of our loop, we’ve accessed an index that doesn’t exist in ‘splitStrTable’. If we modify line 10 to start i at 0, this problem goes away.

CreamBBaby says:

how do you get the thing on the left

KiraTheChallenger says:

what software are you using to code lua

Nestor John Pajaron Maula says:


Sinnathamby Mahesan says:

Example @32 :40 i is increased after assigning value to StringTable, so to return the number of values in the table, you need to return i-1 rather than i. :-)

Alexey Antropov says:

You wrote: setmetatable({}, Animal). It is wrong :) you wasted proper object and just declared its content below so it doesn’t show error.

MW Hashem says:

very helpful thanks!

LightRealms says:

So javascript had a baby with python?

igor Smirnov says:

What the point of writing some “default” value in Animal = {height=0, weight=0, name=”No Name”, sound=”No Sound”} ?
When I create an animal without passing a parasmetres a = Animal:new() thay don’t act as a default value, i.e. height doesn’t store zero , instead it store nil

Parak eet says:

How long would you say it would take to get a general understanding of LUA?

Rokleiktox 11 says:


Hanson says:

The problem I keep having with learning LUA is that it’s so simple, I just don’t know what words to use.

myasadefa says:

1000th comment.

myasadefa says:

This is helpful

Siavash Arya says:

Great video but how could you not come up with a better example for the ternary operator?

Anonymous says:

Amazing! But 12:25 age should be greater than or equal to(>=) not less than or equal to (<=) cause 5 yr olds can’t drive!

DanDanDirt says:

Where does the self come from?

enderdragon1055 says:

whenever i try to go to command prompt and load the file it says ” lua: cannot open luatut.lua: No such file or directory” does anyone know what i am doing wrong, i am typing in cmd “lua luatut.lua”

David Gustavsson says:

You’re wrong about the regex you use. [^…] means “any character not in set …”, s is whitespace and + means “one or more times (greedy)”, so whitespace-delimited words match /[^s]+/. ^ can mean “beginning of line”, but not inside the class structure.

Uher K says:

Thank you

Paulo Cesar Leon says:

Derek, which methods for debugging you would recommend?

Dr Stewts says:

You can only drive if you’re 16 or younger?

Gustavo Salmerón says:

Is it just me or LUA seems so… Different? The syntax… I’m so used to C/C++ and gdscript and some python.

ΔΞRΟ says:

I cant seem to run lua. Can anyone give a tutorial on how to run it on windows :/

Something says:

this syntax is realy werd

Johnson Man says:

io.write(“Dog : “, math.random(10), “n”) why does this not work it always comes out as 8

wetwipes says:

Time for some Roblox

myasadefa says:

I watch it a lot when I have a problem in the studio.

Red PS says:

wow! it’s like having half a semester’s classes in an hour lol. I learnt a lot thanks!

I help anytime says:

I want to mod a server in mta sa… but god my head hurts <:O

Kim says:

That’s a 63-bit Integer. It’s odd..

ElfNet Designs says:

I learned how to do LUA from Garry’s Mod addons creation in 2007..

VIP Trust says:


LakeMake says:

how to save it?

BendApparatus says:

Here let me fix that title for you…
Lua tutorial for people with an extensive background in programming.

There! You’re welcome…

Derpy_ Dolphin says:

just btw you can say print(“hi”); if you want to, lua will just yeet out the semi colon by itself

Jamie S says:

Can I get the child’s version of this video.It’s too hard to follow.

CodeRoid says:

the link of this video says iMac

mrak408 says:

This is the easiest programming language

Write a comment


Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles Show Cars Motorbikes Scooters Rims & Tires Luxury BoatsFashion Sunglasses Luxury Watches Luxury Purses Jeans Wear High Heels Perfumes Jewellery Cosmetics Shaving Helpers Fashion HatsFooding Chef Club Fooding Helpers Coktails & LiquorsSports Sport Shoes Fitness & Detox Golf Gear Racquets Diving Equipment Ski Gear Snowboards Surf Boards Rollers & SkatesEntertainment DIY Guides Zik Instruments Published Books Music Albums Cine Movies Trading Helpers Make Money Fishing Equipment Paintball Supplies Trading Card Games Telescopes Knives VapesHigh Tech Flat Screens Tech Devices Camera Lenses Printers USB Devices PC Hardware Network Gear Cloud Servers Software Helpers Programmer Helpers Mobile Apps Hearing AidsHome Home Furniture Home Appliances Beddings Floor Layings Barbecues Aquarium Gear Safe Boxes Office Supplies Security Locks Cleaning ProductsKids Baby Strollers Child Car Seats Remote ControlledTravel Luggages & Bags Airlines Seats Hotel Rooms Fun Trips Cruise Ships Mexico Tours