Lua Tutorial

Lua Tutorial

Get the Cheat Sheet Here : http://goo.gl/0j15W0
Best Lua Book : http://amzn.to/2yYX5im

Support me on Patreon : https://www.patreon.com/derekbanas

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

50 replies
  1. The Red Gamer
    The Red Gamer says:

    You talk a little too fast, and lost me right quickly. Do you perhapse know any other tutorials with a reduced pace? If it does too fast, it just leaves my memory equally fast, I’m afraid.

    Reply
  2. Sinnathamby Mahesan
    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. 🙂

    Reply
  3. Aaron Parr
    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.

    Reply
  4. BendApparatus
    BendApparatus says:

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

    There! You’re welcome…

    Reply
  5. Maneesha Shetty
    Maneesha Shetty says:

    I am unable to compile the "repeat" example.I am using online lua compiler.when i click on execute it’s pooping up alert as "www.tutorialspoint.com says ".could anyone please help me out?

    Reply
  6. igor Smirnov
    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

    Reply
  7. Sinnathamby Mahesan
    Sinnathamby Mahesan says:

    @50:22 What is the significance of testing aTable == aTable , Isn’t it checking with itself? Do we expect false, by any chance?

    Reply
  8. Jake Sadlak
    Jake Sadlak says:

    Any time I goto youtube and search for an item and see that it’s by "Derek Banas" I immediately select it. These presentation are precise, well explained and accurate. I have NEVER been disappointed.

    Reply
  9. JustOTGFrame
    JustOTGFrame says:

    After making a Roblox leveling interface and system, all I have to do to put certain levels to unlock an area or item is this code

    playerlvl = 10

    if playerlvl ≥ 10 then

    io.write("you can go to that area", "n")
    local localvar = 10

    And so on.

    Reply
  10. Raharth
    Raharth says:

    At 7:30 there is a mistake I think, at least if you compare it to the most current version of lua.
    io.write("5.2 % 3 = ", 5.2 % 3, "n") indeed gives back 2.2 but not 2
    (io.write("5.2 % 3 = ", 5 % 3, "n") actually gives back 2 but I guess that was not his point there?)

    Reply
  11. Ankush singh
    Ankush singh says:

    Hey , I liked the video based on Lua . I work in Cognixia a leafing training provider across the globe . Recently one of our client based in USA has a training requirement on Lua . So I was looking out fpr trainers and that led me here. If you are interested in delivering onsite trainings .do contact at ankush.singh@cognixia.com to understand the requirememt better.

    Reply
  12. Fabrice Chapot
    Fabrice Chapot says:

    Hi ! I wonder how to have my .lua file executed on the terminal like shown in the video. I’m on mac osx. Thank you !

    Reply
  13. David Gingerich
    David Gingerich says:

    Lua is a caveman language, I can’t do myNum++, let alone myNum += 1, no, I have to do myNum = myNum + 1. Seriously, they are still releasing new versions every now and then, WHY NOT ADD SHORTHAND?

    Reply
  14. Maneesha Shetty
    Maneesha Shetty says:

    Awesome explanation with super speed control.But,I feel you skipped clear explanation for files appending.you just opened a file and called file:write("….") .I didn’t understand the difference between "r+" and "a+".

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *