Lua Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

ความคิดเห็น • 1.9K

  • @derekbanas
    @derekbanas  5 ปีที่แล้ว +209

    Learn in One Videos for Every Programming Language
    Subscribe to Bookmark them: bit.ly/2FWQZTx
    C++ : th-cam.com/video/Rub-JsjMhWY/w-d-xo.html
    Python : th-cam.com/video/N4mEzFDjqtA/w-d-xo.html
    Java : th-cam.com/video/n-xAqcBCws4/w-d-xo.html
    PHP : th-cam.com/video/7TF00hJI78Y/w-d-xo.html
    MySQL : th-cam.com/video/yPu6qV5byu4/w-d-xo.html
    JavaScript : th-cam.com/video/fju9ii8YsGs/w-d-xo.html
    C# : th-cam.com/video/lisiwUZJXqQ/w-d-xo.html
    HTML5 : th-cam.com/video/kDyJN7qQETA/w-d-xo.html
    CSS3 : th-cam.com/video/CUxH_rWSI1k/w-d-xo.html
    JQuery : th-cam.com/video/BWXggB-T1jQ/w-d-xo.html
    TypeScript : th-cam.com/video/-PR_XqW9JJU/w-d-xo.html
    ECMAScript : th-cam.com/video/Jakoi0G8lBg/w-d-xo.html
    Swift : th-cam.com/video/dKaojOZ-az8/w-d-xo.html
    R : th-cam.com/video/s3FozVfd7q4/w-d-xo.html
    Haskell : th-cam.com/video/02_H3LjqMr8/w-d-xo.html
    Handlebars : th-cam.com/video/4HuAnM6b2d8/w-d-xo.html
    Bootstrap : th-cam.com/video/gqOEoUR5RHg/w-d-xo.html
    Rust : th-cam.com/video/U1EFgCNLDB8/w-d-xo.html
    Matlab : th-cam.com/video/NSSTkkKRabI/w-d-xo.html
    Arduino : th-cam.com/video/QO_Jlz1qpDw/w-d-xo.html
    Crystal : th-cam.com/video/DxFP-Wjqtsc/w-d-xo.html
    Emacs : th-cam.com/video/Iagbv974GlQ/w-d-xo.html
    Clojure : th-cam.com/video/ciGyHkDuPAE/w-d-xo.html
    Shell : th-cam.com/video/hwrnmQumtPw/w-d-xo.html
    Perl : th-cam.com/video/WEghIXs8F6c/w-d-xo.html
    Perl6 : th-cam.com/video/l0zPwhgWTgM/w-d-xo.html
    Elixir : th-cam.com/video/pBNOavRoNL0/w-d-xo.html
    D : th-cam.com/video/rwZFTnf9bDU/w-d-xo.html
    Fortran : th-cam.com/video/__2UgFNYgf8/w-d-xo.html
    LaTeX : th-cam.com/video/VhmkLrOjLsw/w-d-xo.html
    F# : th-cam.com/video/c7eNDJN758U/w-d-xo.html
    Kotlin : th-cam.com/video/H_oGi8uuDpA/w-d-xo.html
    Erlang : th-cam.com/video/IEhwc2q1zG4/w-d-xo.html
    Groovy : th-cam.com/video/B98jc8hdu9g/w-d-xo.html
    Scala : th-cam.com/video/DzFt0YkZo8M/w-d-xo.html
    Lua : th-cam.com/video/iMacxZQMPXs/w-d-xo.html
    Ruby : th-cam.com/video/Dji9ALCgfpM/w-d-xo.html
    Go : th-cam.com/video/CF9S4QZuV30/w-d-xo.html
    Objective C : th-cam.com/video/5esQqZIJ83g/w-d-xo.html
    Prolog : th-cam.com/video/SykxWpFwMGs/w-d-xo.html
    LISP : th-cam.com/video/ymSq4wHrqyU/w-d-xo.html
    Express : th-cam.com/video/xDCKcNBFsuI/w-d-xo.html
    Jade : th-cam.com/video/l5AXcXAP4r8/w-d-xo.html
    Sass : th-cam.com/video/wz3kElLbEHE/w-d-xo.html

  • @cazulon1122
    @cazulon1122 4 ปีที่แล้ว +556

    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

  • @Tetratronic
    @Tetratronic 9 ปีที่แล้ว +1082

    I just discovered I had magical powers. A couple of days ago I was thinking "Man, I need to learn Lua... I wish Derek made one of his "learn X in an hour" videos. I wonder what else I can make happen...

    • @derekbanas
      @derekbanas  9 ปีที่แล้ว +150

      ***** That's funny :) I'm wondering what my puppet master will have me do next?

    • @januszkowal5545
      @januszkowal5545 9 ปีที่แล้ว +16

      ***** Actually, I think you need more people to cast this spell/ritual, since I also thought of this :)

    • @edgykid4226
      @edgykid4226 9 ปีที่แล้ว +11

      +Gray Fox Make my dad win the lottery. For 1 million dollars.

    • @purch6341
      @purch6341 7 ปีที่แล้ว +1

      make me will lottery

    • @roze942
      @roze942 7 ปีที่แล้ว

      Gray Fox I

  • @ke9n
    @ke9n 4 ปีที่แล้ว +20

    30:11 Just a note: after fiddling around with this, I've come to the conclusion that the caret (^) actually denotes NOT when it is the first character in the brackets. So [^%s] means character that is NOT a space.
    The brackets themselves group the character search together, so [^%A%s]+ would be a pattern that matches characters that are NOT a non-alphabetic character or space, while + keeps matching the search as much as it can until returned nil! :)

  • @MrBrenm84
    @MrBrenm84 6 ปีที่แล้ว +11

    This is the perfect tutorial for anyone who is already familiar with a language and can keep up. It is refreshing to have a tutorial that dives straight in and lets me know what I need, and provides a cheat sheet. Fantastic! Well Done and Thank you!!!

    • @derekbanas
      @derekbanas  6 ปีที่แล้ว +1

      Thank you :) I'm happy it was useful

    • @Player-9
      @Player-9 ปีที่แล้ว

      Yes indeed!

  • @jackmanjls
    @jackmanjls 6 ปีที่แล้ว +8

    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.

  • @kwikb
    @kwikb 3 ปีที่แล้ว +10

    I love the fast pace of your video. I just wanted a quick overview and this delivers. Your presentation is clear and accurate. Your video was posted 6 years ago and I just found it! Cheers and thank you very much.

  • @jaspertanmusic
    @jaspertanmusic 8 ปีที่แล้ว +174

    Great tutorial, thank you! Not sure if pointed out already, but you have 5%3 instead of 5.2%3 at 7:10, which is why you get 2 instead of 2.2 . 5.2%3 gives 2.2 in Lua.

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว +56

      Thank you :) Thank you for pointing out my error and for explaining the results for others that may have been confused.

    • @colefisher4278
      @colefisher4278 8 ปีที่แล้ว +5

      that's explaining! man I'm still confused XD

    • @ryanhart5454
      @ryanhart5454 7 ปีที่แล้ว +2

      he means that % is a remainder in lua so 5.2%3 will returnm 2.2 because its the remainder from 5 / 3

    • @ryanhart5454
      @ryanhart5454 7 ปีที่แล้ว

      he means that % is a remainder in lua so 5.2%3 will returnm 2.2 because its the remainder from 5 / 3

    • @fortuneodesanya
      @fortuneodesanya 6 ปีที่แล้ว

      Sublime Text

  • @biswanathbasak9843
    @biswanathbasak9843 7 ปีที่แล้ว +23

    18:12 String indices in Lua start at 1.

    • @shobharaniheddula6049
      @shobharaniheddula6049 7 หลายเดือนก่อน

      Yes similar to R, thx for reminding again 😊

  • @yabashe
    @yabashe 4 ปีที่แล้ว +15

    This is great, I love how your explanation goes in depth enough and at a very nice rate, not too fast, not too slow :)

  • @Honda_Africa_Twin
    @Honda_Africa_Twin 9 ปีที่แล้ว +5

    I can't thank you enough for all your videos. Your approach on topics, the way you make it all look like a piece of cake is amazing. I'm just so happy I've find your channel, and yours is the only one I get notifications on upload. Thanks a bunch.

    • @derekbanas
      @derekbanas  9 ปีที่แล้ว

      Mike Litorris Thank you for the nice compliments :) I'm very happy that you enjoy my channel.

  • @nickwright330
    @nickwright330 7 ปีที่แล้ว

    This was a fantastic video. To those complaining about the speed, I really enjoy the no BS pace, and I paused after each section to work thru the code myself and see it in action on my machine.

    • @derekbanas
      @derekbanas  7 ปีที่แล้ว

      Thank you :) I'm happy it was useful

  • @kimphuongtran7279
    @kimphuongtran7279 3 ปีที่แล้ว +3

    i'm watching this this video in 2022 and it is still perfect. no need to watch 10 hour long videos if you already understand programming and or know other languages

    • @derekbanas
      @derekbanas  3 ปีที่แล้ว

      Thank you for taking the time to tell me you like them :)

  • @przemysawkukulski7342
    @przemysawkukulski7342 4 ปีที่แล้ว +2

    4:33
    The precision of floating point numbers decreases as their value increases. That's why they are FLOATING point. Try this:
    a = 9999999999999.0001
    b = a + 0.0001
    print(b == a)
    This prints true. You don't have 13 digits of precision.

  • @jamaisnunca
    @jamaisnunca 7 ปีที่แล้ว +34

    A linguagem que me enche de orgulho, apesar de nós brasileiros sermos muito explorados, existem muitas pessoas inteligentes nesse país Lua é só mais um exemplo disso, não podemos desvalorizar essas pessoas, e não podemos viver nas sombras dos países desenvolvidos temos que encontrar nosso próprio caminho, porque somos todos iguais, um dia ainda veremos nosso país brilhar.

    • @warx1680
      @warx1680 3 ปีที่แล้ว +1

      Seu nome deixa o comentario melhor ainda. KKK

    • @LordAlgumaCoisa
      @LordAlgumaCoisa 3 ปีที่แล้ว

      @@warx1680 psé

    • @rbda8921
      @rbda8921 2 ปีที่แล้ว

      Po ... eh tiquo

    • @calengo454
      @calengo454 ปีที่แล้ว

      isso dificilmente vai acontecer com o D.I.T e o imperialismo

  • @cjm_94
    @cjm_94 7 ปีที่แล้ว

    Great and straight-to-the point tutorial! I just have a couple of questions:
    15:50 "age > 13 and true or false" | What is actually happening here? How does this work?
    33:38 "for k, v in pairs{...} do" | What is k and what is pairs? Where are they defined?

    • @sweetberries4611
      @sweetberries4611 5 ปีที่แล้ว

      1. As he said, it looks like a ternary operator, so equivalent of this will be like:
      if (age > 18)
      {
      canvote = true;
      }
      else
      {
      canvote = false;
      }
      2. Seems like pairs{} is an operator, and three dots is a function parameter above.

  • @Bennett_Hart
    @Bennett_Hart 5 ปีที่แล้ว +319

    I'm just commenting so I remember where I was: 14:20

  • @thestaffengineer
    @thestaffengineer 10 หลายเดือนก่อน

    I rather pause to think and rewatch a fast paced video than to keep fast forwarding through bloat. This is gold.

  • @josh.c3457
    @josh.c3457 4 ปีที่แล้ว +75

    I know this video's old, but just want to point out: your OOP example doesn't work! It works for a single instance of that object, but not for consecutive instances. If you create a second Animal, then BOTH animals will have the exact same values, as it basically just creates two aliases to the global Animal object.
    This is because inside the constructor, "self" is referring to the global instance of Animal, not the new instance. The constructor needs to create a new table, assign "self" (the global Animal table) as its metatable index, and then return that new table. Your setmetatable() method at the beginning is a no-op, it does nothing without capturing its result into a variable.
    Here's a working example:
    function Animal:new(height, weight, name, sound)
    newAnimal = setmetatable({}, { __index = self })
    newAnimal.height = height
    newAnimal.weight = weight
    newAnimal.name = name
    newAnimal.sound = sound
    return newAnimal
    end

    • @jacuzzijets
      @jacuzzijets 3 ปีที่แล้ว

      this should have more likes lol i guess not many people checked if it works? :p thanks for the correction @Josh.c

  • @bigmaxporter
    @bigmaxporter ปีที่แล้ว +1

    If you care, you can slap a 00:00 timestamp in the description to set chapters up to make the video more easily navigable

    • @densket_
      @densket_ 10 หลายเดือนก่อน

      vid was 8yrs ago chill

    • @bigmaxporter
      @bigmaxporter 10 หลายเดือนก่อน

      @@densket_ they appear to still be active, and it’s basically already set up

  • @DreadDoom
    @DreadDoom 8 ปีที่แล้ว +95

    Scripting languages always creeps me out... not pre-defining variable types and not having to use curly brackets and semicolons feels really strange to me. Really awesome tutorial tough, I really like the speed especially for someone that already has a basic understanding of programming, since the basics are often very similar to other programming languages.

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว +18

      Yes they are something to get used to. I'm glad you found the video useful :)

    • @awp700
      @awp700 8 ปีที่แล้ว +1

      hhhhjkk

    • @MrPDTaylor
      @MrPDTaylor 4 ปีที่แล้ว +2

      Not pre defining variable types has little to do with the fact that it's a "scripting" language

    • @graphitic5578
      @graphitic5578 4 ปีที่แล้ว +1

      @Nicholas Negron lua is basically just game configuration or modding not like game design

    • @tuananhdo1870
      @tuananhdo1870 2 ปีที่แล้ว

      Look at python: no semicolon, no curly bracket. It is one of the most readable language

  • @kensleylewis
    @kensleylewis 2 ปีที่แล้ว

    Thank you for not getting lost in scientific web machine code language when explaining all of these methods, objects, tables, functions and modules. Super easy to understand.
    This was the best explanation on lua meta-tables I have found on the web.
    Awesome job

    • @derekbanas
      @derekbanas  2 ปีที่แล้ว

      Thank you very much :) Happy to be of help

  • @aaronparr474
    @aaronparr474 6 ปีที่แล้ว +9

    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.

    • @derekbanas
      @derekbanas  6 ปีที่แล้ว +2

      Whoops sorry about that. Thanks for pointing that out for others :)

  • @shamirgeorge
    @shamirgeorge 4 ปีที่แล้ว

    Soooo, I can say that, I'm 85% done with this tutorial. As in, I followed along with the video and cheat sheet, ran all the code, tried different things with it, and followed up with lua documentation when I wanted to know more. This is a really great tutorial. I'm still getting the hang of loops, closures, and fucntions, but I'll get there. After this one, I'm going to go for Julia, Clojure, Rust, and F#. Hopefully, soon, I'll know 10 different programming languages.
    "If I can do it, anyone can."
    -Derek Banas
    After that, I'm going to complete the data science and math videos. I'm currently learning this stuff solely to stay sharp. Perhaps some time in the future, it'll all come together and I'll know what to do with the knowledge. Until then, I"m just happy learning.

    • @derekbanas
      @derekbanas  4 ปีที่แล้ว +1

      I love learning new things everyday as well. That great thing is that once you learn data science you’ll see the world in all new ways. All of a sudden that which was once confusing will now make sense. It is almost like being able to see you future.

  • @okandme
    @okandme 4 ปีที่แล้ว +219

    Game programming with lua is extremely easy

    • @csongorkertesi976
      @csongorkertesi976 4 ปีที่แล้ว +16

      You mean scripting?

    • @okandme
      @okandme 4 ปีที่แล้ว +3

      @@csongorkertesi976 yes

    • @edwingarcia5043
      @edwingarcia5043 4 ปีที่แล้ว +16

      @@csongorkertesi976 Programming.

    • @edwingarcia5043
      @edwingarcia5043 4 ปีที่แล้ว +15

      @@okandme You are right, you are *programming* my dude.

    • @w5e
      @w5e 4 ปีที่แล้ว +16

      Can vouch, especially with Roblox and Love.

  • @Sccoropio
    @Sccoropio 9 ปีที่แล้ว

    This, for me, is what I exactly need! It's straight to the point with no incessant talking! You are amazing, bro!

    • @derekbanas
      @derekbanas  9 ปีที่แล้ว

      Thank you I did my best

  • @jckaicedo
    @jckaicedo 9 ปีที่แล้ว +54

    45:20 I think the answer in cm should be 365.760 cm. You used + instead of * in the convert.lua module. Anyway, great video!

    • @laykefindley6604
      @laykefindley6604 5 ปีที่แล้ว +7

      Came here to say this. I'm glad I'm not the only one to catch it.

  • @mateusoliveira2776
    @mateusoliveira2776 4 ปีที่แล้ว +2

    is it just me, or is this one of the most fun and beginner friendly languages out there? it is so "readable", it really gives the sense of talking to the computer, so much fun. it must be great to teach programming. idk it's so cute like "if this is true then do this" lol.

    • @derekbanas
      @derekbanas  4 ปีที่แล้ว +1

      Lua is a fun language I agree

  • @masterride3604
    @masterride3604 5 ปีที่แล้ว +87

    Me at 2:00 : “kinda similar to python“
    Also me at 2:10 : "nope"

    • @xeome5596
      @xeome5596 5 ปีที่แล้ว +3

      you can use print too

    •  5 ปีที่แล้ว +3

      very similar to python except to oop & classes, but meta makes its work

    • @sh4-p339
      @sh4-p339 5 ปีที่แล้ว +1

      haha

    • @primeroyal7434
      @primeroyal7434 4 ปีที่แล้ว

      No programming language(except Python) suits me nor it is easy to me. Java and C+(And it's brothers) eats my brain off. I tried Ruby because it is like the best and easiest static language but it also confuse me. so guess what, I will stick to my Python and possibly do AI interaction.
      Edit: I accidently typed Ruby instead of Rust.

    • @MrPDTaylor
      @MrPDTaylor 4 ปีที่แล้ว

      @@primeroyal7434 Ruby is a dynamically typed language

  • @k98killer
    @k98killer ปีที่แล้ว +1

    Correction: around 7:20, the claim was made that the modulus operator "automatically cuts off" decimals, but the actual code being ran did not include a decimal -- only the string portion describing the operation had the decimal. As of Lua 5.1, executing `5.2 % 3` will give the result 2.2, not just the integer portion.

  • @SkyyySi
    @SkyyySi 3 ปีที่แล้ว +6

    If I'm not mistaken, if you put your timestamps before the chapter title, youtube will show them on the progressbar in the player.
    (So formatted like:
    23:24 Chapter name
    instead of
    Chapter name 23:24
    )

  • @unusedacount410
    @unusedacount410 5 ปีที่แล้ว +1

    Nice, By the way If you are totally new to programing, and never used any type of language, here is the list of languages to learn in order!;
    Python - Easy to learn is similar to others - 1
    Lua - Nice, and powerful and easy to understand if you learned a mother language - 2
    Java - well, this is a popular game language but just get to under stand it and you will be good ;) - 3 1/2
    C# - A very popular game language ProIsh language... You can easily find a job with this one its also very complex, but once you get use to it you will be in love with this one - 4
    Language of Choice - NICE, you are a pro now, Have fun make some money or have a useful hobby! - 5

  • @xavierreardon5580
    @xavierreardon5580 8 ปีที่แล้ว +276

    I was trying to code but this one coding language keeps kicking my ass.

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว +44

      Keep at it and you'll get it :)

    • @inarisound
      @inarisound 8 ปีที่แล้ว +71

      The Language27 ?

    • @xavierreardon5580
      @xavierreardon5580 8 ปีที่แล้ว +42

      Inari Kami Yeah, The Language27!

    • @inarisound
      @inarisound 8 ปีที่แล้ว +37

      Some say that The Language27 is the first language that programmed itself and it was born from fire !

    • @xavierreardon5580
      @xavierreardon5580 8 ปีที่แล้ว +39

      Inari Kami I heard The Language27 can code a chunk longer than a professional programmer!

  • @haiyun77
    @haiyun77 5 ปีที่แล้ว

    31:25 the total number of words should be “i-1”, instead of i, since you did “i=i+1” at the end of each loop. That’s also the reason you got the last line output of “nil” when you tried to print out each word.

  • @mrmaxwell0701
    @mrmaxwell0701 3 ปีที่แล้ว +4

    Wow, thanks a lot for this very complete demonstration of lua's basics, it is a goldmine !

  • @rooneyjohn
    @rooneyjohn 4 ปีที่แล้ว +1

    Thank you for making a no nonsense video. It is refreshing to have information without all the extra junk and funk everyone puts into tutorials. THANK YOU.

    • @derekbanas
      @derekbanas  4 ปีที่แล้ว

      Thank you very much :) I'm happy you liked it

  • @Max-bh8tg
    @Max-bh8tg 9 ปีที่แล้ว +309

    How to you manage to learn so many languages?

    • @zKite00
      @zKite00 9 ปีที่แล้ว +161

      +Max L. learning 1 language will make another 1 easy to learn

    • @victornaut
      @victornaut 9 ปีที่แล้ว +83

      +Maximilian Lloyd If you learn C++ you can easily lean C#, Java, F# and even Python, *Lua*, Perl, Ruby ans so on

    • @victornaut
      @victornaut 9 ปีที่แล้ว +8

      ***** I think so. It's a pretty weird language for me as well, but you just need some time to get familiar with the "alien" side of it and you're ready to go.

    • @victornaut
      @victornaut 9 ปีที่แล้ว +1

      ***** Nah, it's not that complex, it's just confusing... Alright! know what? You win LOL

    • @WozzSWE
      @WozzSWE 9 ปีที่แล้ว

      +Vededron use jQuery. They say it's better than JS. :)

  • @peterbezak5204
    @peterbezak5204 6 ปีที่แล้ว +1

    This video is perfect for people who already know some other language and want to learn Lua.

  • @HansonJ
    @HansonJ 6 ปีที่แล้ว +60

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

    • @ewowoi
      @ewowoi 6 ปีที่แล้ว +1

      what do you mean by word ?

    • @vital1ty548
      @vital1ty548 6 ปีที่แล้ว +3

      NerdgineerTV Im pretty sure he meant he cant find out what to put in the procedures; parts of the procedures.

    • @gaieok7899
      @gaieok7899 6 ปีที่แล้ว

      Yes ikr

    • @cracklelacquer5602
      @cracklelacquer5602 6 ปีที่แล้ว +1

      becareful with caps and word

    • @user-es4vu9sf9l
      @user-es4vu9sf9l 4 ปีที่แล้ว +1

      Doesn’t make sense. How can something “simple” be hard to learn

  • @admiralagk922
    @admiralagk922 4 หลายเดือนก่อน

    What a mouthful. Now, while this tutorial touched upon the very basic topics of lua, it's still a great tutorial and I appreciate your work!

  • @stalepalemale
    @stalepalemale 7 ปีที่แล้ว +4

    great tutorial.
    One thing though the inheritance isn't quite OO. Typical in an OO language your descendant class would not need to define all the class members, you could simply call the inherited constructor and then simply add anything you wanted, so in your example the favfood for the cat is would you need to add.

    • @opposite4893
      @opposite4893 5 ปีที่แล้ว +2

      Yeah, I came to the comments looking for an answer for this.
      Is it safe to assume that inheritance can be achieved by calling Animal:new() inside Cat's constructor, then adding any additional Cat functionality, and returning the extended Animal table?

  • @xGuidoM
    @xGuidoM 6 ปีที่แล้ว

    I wonder why nobody pointed out the mistake at 31:20? You should switch lines 13 and 14, and change line 10 to "local = 0" to make the function really return the number of words.
    That is the reason you have to fix the loop later on by subtracting 1 from numOfStr... 32:44: there is not always am extra nil. It means you accessed an uninitialized element in the table...
    But other than that, I really liked the video! The speed is just perfect!

    • @derekbanas
      @derekbanas  6 ปีที่แล้ว

      Thank you for pointing that out :) Sorry about the error

  • @CorporaMedicina
    @CorporaMedicina 5 ปีที่แล้ว +17

    10 Print "Hello world"
    20 If inkey$ " " GoTo 40
    30 GoTo 10
    40 End
    Run

    • @martinnieva8484
      @martinnieva8484 5 ปีที่แล้ว

      What is that? I'm curious

    • @akira9449
      @akira9449 5 ปีที่แล้ว +1

      @@martinnieva8484 BASIC

    • @martinnieva8484
      @martinnieva8484 5 ปีที่แล้ว

      @@akira9449 Thank you very much!

    • @fatih6722
      @fatih6722 5 ปีที่แล้ว

      Its like science dude. Like Quantum physic.

    • @demomiccraft1961
      @demomiccraft1961 5 ปีที่แล้ว +1

      Lua is easier the basic

  • @fragmister
    @fragmister 3 ปีที่แล้ว +2

    It has been forever since I've watched Derek and when he said "Well hello internet", I felt that.

    • @derekbanas
      @derekbanas  3 ปีที่แล้ว

      That's cool! Thanks for stopping back

  • @TheDebare
    @TheDebare 9 ปีที่แล้ว +10

    I had to see what I would use Lua for. It can be used for making World of Warcraft addons. Another great video Derek Banas

    • @derekbanas
      @derekbanas  9 ปีที่แล้ว +4

      Allen Law Thank you :) Yes many people learn it just for that reason

    • @austinrau6051
      @austinrau6051 9 ปีที่แล้ว +2

      Allen Law Corona SDK.

    • @TheDebare
      @TheDebare 9 ปีที่แล้ว +1

      Checking it out Austin rau thank you

    • @Threebow
      @Threebow 9 ปีที่แล้ว +2

      +PrankCentral Garry's Mod is what I seek to learn it for.

    • @sswanky3200
      @sswanky3200 9 ปีที่แล้ว

      +Allen Law MTA:San Andreas,cocos 2d

  • @TheValvier
    @TheValvier 8 ปีที่แล้ว

    omg! first of all thank you! most videos just throwed me to the os x website and I did complete a mess because I did not understood what was wrong. It's really important to mention as much system as possible so the viewers could actually understand and follow and understand. Thank you so much!

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว

      You're very welcome :) I'm glad I could help

  • @ViewBothSides
    @ViewBothSides 5 ปีที่แล้ว +3

    Good video. Lua quirks: arrays & strings index from 1, not 0.
    Your ternary example with booleans is misleading "foo = (condition) and true or false" as that is identical to "foo = condition"
    Better example, showing wierd Lua quirk, would be:
    age = 13
    foo = (age

  • @Gruby7C1h
    @Gruby7C1h หลายเดือนก่อน

    Tip: don't return the i variable at 31:20, it will be off by one. #stringTable will contain proper length.

  • @LK-zn4cl
    @LK-zn4cl 8 ปีที่แล้ว +4

    I was watching this video to learn lua so I can get better at using unitale... I can be a boss in it now :D thnx...

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว +2

      I'm very happy I helped :)

    • @asierx7047
      @asierx7047 6 ปีที่แล้ว

      Same :D

  • @jorajungs1413
    @jorajungs1413 4 ปีที่แล้ว

    If you put a 0:00 at the beginning of the timestamps and the time in front of the title like this:
    Data Types 3:43 -> 3:43 Data Types
    You get nice chapters in the timeline

  • @redps8611
    @redps8611 6 ปีที่แล้ว +3

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

    • @derekbanas
      @derekbanas  6 ปีที่แล้ว +1

      I try not to waste time :)

  • @SuperFerz
    @SuperFerz 2 หลายเดือนก่อน

    One of the features I like from Lua is that is tolerate various coding practices. For example, no need to adhere to indentation convention, whitespacing, etc. And in this video Derek used camelCase and not underscore_naming practice.
    Which reminds me of the Pascal programming language! Maybe Lua is Pascal's case-sensitive version (but without semicolons)!!

  • @w00tyd00d
    @w00tyd00d 8 ปีที่แล้ว +11

    This was a great tutorial, it taught me a lot about LUA so thank you :) I do have one question tho and that's at the end when you started talking about pseudo-OOP with LUA, you initially defined the "Animal" table with default values (height, weight, etc) and then used that as your metatable in the initialization function for your Animal object, but then later when making the Cat object you were able to pass a different value (favFood) through the previously inherited metatable without it having a default value already defined within it.
    So my question is why is it necessary to set up your initial metatable with default values if you're able to add values in on the fly?

    • @JohnSmith-ix8ob
      @JohnSmith-ix8ob 8 ปีที่แล้ว +4

      rule #1: "Lua not LUA"

    • @w00tyd00d
      @w00tyd00d 8 ปีที่แล้ว +2

      lol little pedantic but ok ;) any thought on my question tho?

    • @geogreenmanu
      @geogreenmanu 6 ปีที่แล้ว

      inheritance?

    • @Davi_Dash
      @Davi_Dash 2 ปีที่แล้ว

      I know diss commentary is old but, if you do put the setmetatable in the beginning , i know... you can also charge the values on the fly, but you can use the values you didn't change to use them to be part of the class itself, diss what we call static values , you can use diss for some cool stuff like count how many instances of the class you have , you can modify a value based on certain instances and other cool and useful things.

    • @theeox
      @theeox 2 ปีที่แล้ว

      I am pretty sure he did that only to show you a reference as to what is going to be in the table. defining it up front is not necessary. Just being repetitive to show you what is in it.

  • @piorism
    @piorism 7 ปีที่แล้ว +2

    Absolutely loving the format (layout and speed). Fantastic stuff.

    • @derekbanas
      @derekbanas  7 ปีที่แล้ว

      Thank you very much :)

  • @unperrier5998
    @unperrier5998 2 ปีที่แล้ว +3

    Thanks, I didn't know a thing about Lua, but it's quite simple. Not a complicated language at all.
    That said, I wished you had picked better examples. For instance the first table at 25:30 is confusing to me because you kept using index 1. What is confusing is that we don't know if there is an element zero at all, and if so why it's not reported in the length calculation. A bit more explanations of what actually happens to index zero would have been very useful. As it turns out there is an element zero and it contains nil (I've checked).
    And the other issue is at 31:30 when you return the wrong number of words (one too many), but when you get an extra "nil" you then explain it by saying that tables are always nil-terminated, which isn't true at all (I've checked too).
    Barring those two confusing points (well the second is real easy to spot to someone with programming experience), the pace is good and the content is really practical. Thanks again.

    • @lunchbox1553
      @lunchbox1553 2 ปีที่แล้ว

      No, there is no element 0. All tables in Lua start with an index of 1. The only reason you are getting nil is simply because it doesn't exist. And, also, all tables really should be nil-terminated. If your result showed that to be false, then please explain what you did to test it because I would love to know how that could be possible.

  • @ricsmith5085
    @ricsmith5085 7 ปีที่แล้ว

    I was told I needed to learn Lua in a day for a client project and this really helped me nail the syntax and fundamentals down. Thanks!

    • @derekbanas
      @derekbanas  7 ปีที่แล้ว

      That's great :) I'm happy it helped

  • @V1c7ori0us
    @V1c7ori0us 8 ปีที่แล้ว +8

    @18:16
    I thought lua starts with the index of 1 and not 0

    • @hari.7679
      @hari.7679 3 ปีที่แล้ว

      it does start at 1

  • @sinnathambymahesan1268
    @sinnathambymahesan1268 6 ปีที่แล้ว

    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. :-)

  • @timhawthorn7903
    @timhawthorn7903 7 ปีที่แล้ว +4

    Great tutorial, although I think it's confusing to compare Lua tables to arrays - they are more like mappings or Python dictionaries. The info about metatables is really useful. Thanks!

    • @ReeSoo_
      @ReeSoo_ ปีที่แล้ว +2

      Lua tables are hard to understand but can be much more logical and easy to use once you get familiar with them!!!

  • @thenottakenone
    @thenottakenone 3 ปีที่แล้ว +1

    Best hour I spent on Lua tuts thank.
    @Derek Banas 16:18 why not canVote = age > 18
    oor another example for ternary ops (because „? true : false“ should be cut imho)

  • @oliverbenson83
    @oliverbenson83 8 ปีที่แล้ว +3

    If you're having trouble installing Lua, here's how I did it:
    Install Lua 5.1.4 here. code.google.com/archive/p/luaforwindows/downloads. Yoiu can then run that version of Lua in your command line. On your pc, look up "cmd". Open that up and then type "lua". You can now write Lua code :)
    If you want to use an IDE then I recommend downloading an IDE called ZeroBrane Studio. That's what I'm using at the moment and it's working decently well. Hope that helps. It's definitely a frustrating experience doing it the "right" way. Let me know if you need any help!

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว

      +Oliver Benson Thank you for helping :) I downloaded using the sources I showed in the video. You may have to put lua in your path if you are on Windows. Maybe that was the problem people were having?

    • @oliverbenson83
      @oliverbenson83 8 ปีที่แล้ว

      +Derek Banas Hi Derek. Thanks for replying. That's how I did it as well. However on www.lua.org/download.html you can download version 5.3.2 which I had a lot of trouble downloading. Got there in the end though and just did it the way you did! The other question I have is how I can get the same software you're using. What I mean is on my pc, I'm using Windows 10. I can program in Lua on the cmd, but I'd prefer programming in the same format you are i.e. use Sublime Text (which I've heard it pretty good) and the terminal. I'm not sure how to go about doing that though. I hope that makes sense and you can help me out. Thanks for all the videos you make!

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว

      +Oliver Benson Sublime Text works on every OS and you can get it here www.sublimetext.com/3 If you want a free IDE that is almost exactly the same take a look at Atom atom.io/ Yes you can use your command line just like I use the terminal. Everything works pretty much the same. I hope that helps :)

    • @OliverBenson2024
      @OliverBenson2024 8 ปีที่แล้ว

      +Derek Banas Do you know a way of downloading the latest version because my pc doesn't seem able to open tar.gz files? Thanks for recommending Atom :) Is the terminal the same thing as the command line? It's just I don't quite understand it. How do I get Sublime Text to interact with the terminal?

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว +1

      +Oliver Benson You can use the install program on Windows for Atom and Sublime text. You don't need the tar file. I just recompile in the terminal. You can run the terminal in both IDEs, but I have never done that.

  • @Smugger
    @Smugger ปีที่แล้ว

    EDIT: This issue was addressed and resolved, I finished the video, I think it was great! Quick way to understand Lua and syntax for people that already understand programming concepts and coming from other languages.
    -Made it to 14 min in, I enjoyed it actually, however, after 4 ad rolls in under 15 min, I am not going to keep watching this, I suggest you edit your ad rolls.-

    • @derekbanas
      @derekbanas  ปีที่แล้ว +1

      Sorry about that. I normally only use one five second skippable ad. I switched it back.

    • @Smugger
      @Smugger ปีที่แล้ว

      @@derekbanas I appreciate that, I am going to finish it then. ;) Also, I didn't mean you needed to shut off all of them, I would have been fine with say every 10 min or so. It was just overboard before. Thank you!

  • @damienk777
    @damienk777 8 ปีที่แล้ว +133

    It feels so weard and wrong not to use '';'' in lua code :(

    • @Verodoxys
      @Verodoxys 8 ปีที่แล้ว +7

      +Damien K Lots of languages don't conclude statements with semicolons, like Python and Ruby, to name a couple.

    • @ghostpunk3159
      @ghostpunk3159 8 ปีที่แล้ว +10

      +Damien K It's honestly easier for me, lol. I for some reason have a hard time remembering to end every line.

    • @tentergram4259
      @tentergram4259 8 ปีที่แล้ว +9

      I'm the opposite, I started off with Lua and once I've started C++, it felt unusual.

    • @audiemurphy7421
      @audiemurphy7421 8 ปีที่แล้ว +4

      Well, if it confuses you that much just use it xD

    • @flagkdsa180
      @flagkdsa180 8 ปีที่แล้ว

      and GML (game maker language)

  • @zh4ngx
    @zh4ngx 3 ปีที่แล้ว +1

    Amazing how much I was able to absorb watching this at 1.5x! Great video :)

    • @derekbanas
      @derekbanas  3 ปีที่แล้ว

      Thank you very much :) I'm happy I could help

  • @ryukshinigami5106
    @ryukshinigami5106 5 ปีที่แล้ว +6

    Nice now I can spend rest of my life ricing AwesomeWM.

  • @Maxxermaximus
    @Maxxermaximus 2 ปีที่แล้ว

    12:20 the "elseif" statement checks (age=16).
    If you leave it like it is in the video it checks:
    elseif age is smaller or equal 16. Smaller 16 you checked already in the "if" statement, so you get her only equal 16. and (age

  • @franciscopdinis
    @franciscopdinis 8 ปีที่แล้ว +2

    Hey :D
    Do you know if that covers the "MTA Lua" ?? Its a bit different from original Lua

  • @MrGustaphe
    @MrGustaphe 6 ปีที่แล้ว +1

    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.

  • @BendApparatus
    @BendApparatus 6 ปีที่แล้ว +43

    Here let me fix that title for you...
    Lua tutorial for people with an extensive background in programming.
    There! You're welcome...

    • @hamzahahmad1670
      @hamzahahmad1670 5 ปีที่แล้ว +11

      Well, it's kind of dumb if anyone expects that a >1 hour tutorial will cover basic programming fundamentals. All of Derek's crash courses focus on syntax, not basic programming fundamentals

    • @yegorgribenuke6853
      @yegorgribenuke6853 5 ปีที่แล้ว +1

      @@garybrock8456 Sooooo, i want to learn Lua from zero. I only know some Pascal and no more, what should i do?

    • @설리-o2w
      @설리-o2w 5 ปีที่แล้ว

      @@yegorgribenuke6853 Look at a different tutorial mate. These tutorials are aimed for programmers meaning you should know how to program as in basics fundamentals of programming. These crash courses are literally him teaching you the syntax of a language I come from C++ so all of this is really easy to understand. I don't want to watch a Lua tutorial that explains to me what functions, loops, selections and so on are I already know what they are. Am here to learn the syntax of this scripting language.

    • @yegorgribenuke6853
      @yegorgribenuke6853 5 ปีที่แล้ว

      @@설리-o2w they teached us Pascal as programming language for us understand others.
      I understand how it works, i do not know any commands and any functions, thats my problem!

    • @설리-o2w
      @설리-o2w 5 ปีที่แล้ว

      @@yegorgribenuke6853 well watch the video then. That's the whole point of learning this language syntax :D.

  • @dimitrisstoikou3815
    @dimitrisstoikou3815 5 ปีที่แล้ว

    Straight forward,no bs,just lua,excellent!

    • @derekbanas
      @derekbanas  5 ปีที่แล้ว +1

      Thank you very much :)

  • @awesomepwner0930
    @awesomepwner0930 9 ปีที่แล้ว +9

    I'm on windows and this looks a lot different then it does on mac, I can't even get the bar to come up

    • @mysteretsym
      @mysteretsym 8 ปีที่แล้ว +2

      open SciTE, not the command prompt thing if you haven't already. That's your IDE. Click view and select output for a place where the output can show and you need to save a script before you can run it.

    • @SecretAgentPaul
      @SecretAgentPaul 4 ปีที่แล้ว +1

      tried Viagra?

  • @boringchannel6313
    @boringchannel6313 3 ปีที่แล้ว

    he explained everything so fast!
    THAT'S WHAT I WANT THANK YOU!!

  • @StephJ-yn2sw
    @StephJ-yn2sw 8 ปีที่แล้ว +3

    That's just perfect. Thank you :-)

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว +2

      +Stéphane JAILLIARD Thank you very much :)

  • @lonniebest4697
    @lonniebest4697 3 ปีที่แล้ว

    Well done. High density. Nothing but pertinacity.

  • @Holy-Terrorist
    @Holy-Terrorist 5 ปีที่แล้ว +3

    **=** Basic Lua codes can work on Roblox Studio?

    • @kierstyn3330
      @kierstyn3330 5 ปีที่แล้ว

      yes. Roblox is ran off of Lua and basic Lua codes.

    • @Holy-Terrorist
      @Holy-Terrorist 5 ปีที่แล้ว

      @@kierstyn3330 **=** Yes, but not all codes, and Roblox use Ogre3D engine.

  • @angrymurloc7626
    @angrymurloc7626 4 ปีที่แล้ว

    This is such a top tier tutorial. Insane pace, perfect articulation combined with similairly awesome editing. Nice Coverage, and soothing voice. The best I've ever seen

    • @derekbanas
      @derekbanas  4 ปีที่แล้ว

      Thank you for the wonderful compliments :)

  • @cgktheking
    @cgktheking 4 ปีที่แล้ว +6

    I feel like I’m the only one here that isn’t here for roblox and is here because my teacher forced to class to learn LUA

    • @slimeball8325
      @slimeball8325 4 ปีที่แล้ว

      Hi, so I'm here from a Minecraft mod.

    • @isaiah4tone
      @isaiah4tone 4 ปีที่แล้ว

      LOL

    • @theturtle9724
      @theturtle9724 4 ปีที่แล้ว

      Frosty Vex what is she a teacher for?

  • @mareinstalator
    @mareinstalator 9 ปีที่แล้ว

    Ok, now you've officially beat Darth Vader as the most inspirational person on youtube! Thanks for your dedication, and if you had time unity3d.. been developing a game on android thanks to your tutorials, then decided to switch to unity, and for 2 weeks been digging in da' documentation...suuucks. Keep them coming, and Lynda should hire you!

    • @derekbanas
      @derekbanas  9 ปีที่แล้ว

      dilo00o That's funny :) Thank you I'll see what I can do about covering Unity

  • @kosinparuchabutr4007
    @kosinparuchabutr4007 3 ปีที่แล้ว +8

    "aight imma learn to script for a school project"
    *2 hours later*
    what the fuk is this?

  • @ajaydhar3052
    @ajaydhar3052 4 หลายเดือนก่อน

    Thanks!

    • @fuji_films
      @fuji_films 4 หลายเดือนก่อน

      The bobux man dropped 100 $

  • @serhiy2020
    @serhiy2020 4 ปีที่แล้ว +5

    16:04 that seems a bit redundant, can't you just say:
    canvote = age > 18

    • @michielarkema
      @michielarkema 4 ปีที่แล้ว +1

      Not if you want to return a different value that's not an boolean

    • @Epoxydeable
      @Epoxydeable 4 ปีที่แล้ว

      Yeah, strings probably would fit more naturally to illustrate ternary operator, but my concern is that lua version of it is pretty weird in itself.

    • @serhiy2020
      @serhiy2020 2 ปีที่แล้ว

      @@michielarkema that's kind of my point. ternary operator is better illustrated with non-boolean types

  • @miykaylataylor2893
    @miykaylataylor2893 5 ปีที่แล้ว +1

    Lua gang! I'm excited to get into something new, thanks for the opportunity.

  • @theultimatesr8119
    @theultimatesr8119 8 ปีที่แล้ว +3

    You go a little to fast but you explain very well :)

    • @derekbanas
      @derekbanas  8 ปีที่แล้ว +3

      Thank you :) Sorry about the speed

    • @nikhilghelani828
      @nikhilghelani828 8 ปีที่แล้ว +2

      go to setting and lower the speed. thats what i do when doing practice at same time.

    • @ConFusion
      @ConFusion 8 ปีที่แล้ว +1

      haha, then he sounds like drunk!

  • @spodzone
    @spodzone 2 ปีที่แล้ว

    5.2 % 3 *IS* 2.2. Helps to evaluate the same expression as the text suggests.

  • @limitedfair
    @limitedfair 3 ปีที่แล้ว +3

    im skipping maths lol

  • @mickresistor4373
    @mickresistor4373 5 ปีที่แล้ว

    This is crazy. I searched for 9.2 quintillion and the first result was that the odds of successfully choosing a perfect NCAA March Madness bracket are 1 in 9,223,372,036,854,775,808. exactly one digit higher than the highest number you can go in Lua. Turns out that number is an even composite number. It is composed of a single prime number (in this case two) multiplied by itself sixty-two times.

  • @thecodingevolution1182
    @thecodingevolution1182 9 ปีที่แล้ว +7

    Why are you using io.write, why not just print lol.

    • @PixelBytesPixelArtist
      @PixelBytesPixelArtist 6 ปีที่แล้ว +6

      L0gicz
      The difference is that io.write adds text to the most recently used line while print creates a new line
      Example:
      for I=1,4 do
      io.write(“cool”)
      End
      Terminal:
      coolcoolcoolcool
      Example:
      For I=1,4 do
      Print(“cool”)
      End
      Terminal:
      Cool
      Cool
      Cool
      Cool

    • @catdude2319
      @catdude2319 5 ปีที่แล้ว

      @@PixelBytesPixelArtist but you can also do print("coolcool") so yeah

    • @PixelBytesPixelArtist
      @PixelBytesPixelArtist 5 ปีที่แล้ว

      Well it's good for making text matrixies if you arnt using a 2d engine.
      example:
      for r=1,5 do
      print("")
      for i=1,5 do
      io.write(" 0 ")
      end
      end
      terminal:
      0 0 0 0 0
      0 0 0 0 0
      0 0 0 0 0
      0 0 0 0 0
      0 0 0 0 0
      --If you used varibles instead of text you could set each point to something other than " 0 "

    • @PixelBytesPixelArtist
      @PixelBytesPixelArtist 5 ปีที่แล้ว

      @@hydropage2855
      Sorry, i dont know the difference, i dont use the system library much.

  • @eggstatus5824
    @eggstatus5824 2 ปีที่แล้ว +1

    The reason that 9223372036854775807 is the largest number you can hold is because this number is the 64 bit integer limit. 64 bit programs simply cannot hold more data than that. The only way to display a higher number than this is by using a string and not an integer

  • @Ihelpanytime
    @Ihelpanytime 6 ปีที่แล้ว +9

    I want to mod a server in mta sa... but god my head hurts

  • @zj886
    @zj886 4 ปีที่แล้ว

    Very useful tutorial! The title really did not lie!

  • @lenamoonvalley5495
    @lenamoonvalley5495 5 ปีที่แล้ว +7

    Legit Roblox's tutorial teaches you 'Hello World' in their tutorial and in Studio.

    • @fire-fx2ct
      @fire-fx2ct 5 ปีที่แล้ว

      eww roblox player

    • @JayRain
      @JayRain 5 ปีที่แล้ว

      @@fire-fx2ct why

    • @poisebuildbetter
      @poisebuildbetter 4 ปีที่แล้ว +1

      Hello world is the most common text in tutorials. Of course you'd fins it there too

    • @hqgraphics1163
      @hqgraphics1163 4 ปีที่แล้ว

      Lua is a language that roblox just happens to use. He is teaching normal lua for real programmers.

  • @user-ob5hj5vn8c
    @user-ob5hj5vn8c 4 ปีที่แล้ว

    Hi, just want to let you people know that the code from 52:00 onwards is pretty much completely wrong. Reference “self” is pointing to the parent table in the :new function, not a new table. A new table isn’t even being created. in fact, setmetatable({},parent) on its own literally doesn’t do anything if you don’t assign a variable to the returned table. Alongside that, the setmetatable is also useless because there are no meta-methods in the parent table. (E.G. __index or __call). The reason the new function works when printing is because you are modifying values of the parent table, (self) and returning the parent table (self), which gives the appearance of a new object being made. If you created 2 animal objects using that func and printed out their memory addresses, you would see that they are the same object.

    • @pluckyhero2975
      @pluckyhero2975 4 ปีที่แล้ว

      Is the a way to fix the code to make it behave in a way to create new animal objects? Sorry for necro post, but be a real big help if you could get the code to work as it seems to be intended.

  • @aznashwan
    @aznashwan 9 ปีที่แล้ว +4

    Derek Banas
    First off; very nice video; as always. I really enjoy your stuff and I think it's all really awesome.
    One small thing with a big impact I had to point out though:
    In the 'OO' section of this video; you're constructors are wrong in a very subtle way.
    The way you wrote it; your X:new()'s are simply modifying the existing table and returning it.
    You can check this by simply making two Animal `objects` and comparing them with ==; same goes for two Cat `objects`.
    I've written the necessary changes together with a few explanations here:
    paste.ubuntu.com/11793664/
    Again, I very much love your videos, and very subtle mistakes like these are perfectly natural. Pitching in a little hand is the very least I could do.
    Thanks again for all the great content; you rock!
    Nashwan.

    • @derekbanas
      @derekbanas  9 ปีที่แล้ว

      Nashwan Azhari Thank you very much for fixing that :)

  • @DerHozzy
    @DerHozzy ปีที่แล้ว +2

    Time goes by so fast. I watched this video around a month after it came out to help me learn it for roblox. I stopped playing roblox 4 years ago.

    • @Exe_Aiden
      @Exe_Aiden หลายเดือนก่อน

      Jeez so u watched this 9 years ago

  • @danielfrland6058
    @danielfrland6058 8 ปีที่แล้ว +8

    Just wondering, are there annyone else than me that is watching this for help to script farming sim? :P

  • @greatestgrasshopper9210
    @greatestgrasshopper9210 2 ปีที่แล้ว +1

    I can only imagine how frustrating it would be to not have any programming experience and watch this video, lol. I love that you did it for an audience of people with experience, as I do not have to waste an extra 5 or so hours on some slowpoke course lol.

    • @derekbanas
      @derekbanas  2 ปีที่แล้ว +1

      Thanks :) Yes I tend to make videos for people that already know the basics of programming. I hate wasting time

    • @soapaza2973
      @soapaza2973 2 ปีที่แล้ว

      ikr i was so happy to find this course that under 1 hour and goes rapidly through subjects that are for example included in python

    • @justsomeguythatlikesart
      @justsomeguythatlikesart 2 ปีที่แล้ว

      Lmao I was expecting a "Explain it to me like I'm Five" kind of tutorial, still helpful since I briefly do Python and Java Script in Highschool and tried Roblox lua on my own before actual lua. So "some experience" lol

    • @scirvy
      @scirvy 2 ปีที่แล้ว

      @@derekbanas I know zero code, I'm 14 years old, have never coded past scratch junior no matter how my parents encouraged me from ages 6-10. To say I am lost watching this video is an understatement 💀

  • @absolutelybagel2218
    @absolutelybagel2218 5 ปีที่แล้ว +3

    Time to hack some mobile games

    • @thunderstruk-yk5sh
      @thunderstruk-yk5sh 5 ปีที่แล้ว

      Zetta_Stone I was gonna code some gmod but ok

  • @adrianlewis7239
    @adrianlewis7239 3 ปีที่แล้ว +2

    Excellent outline of Lua and I would be interested also in functional programming with Lua.

  • @deletedchannel3293
    @deletedchannel3293 8 ปีที่แล้ว +11

    Anyone who knows why this won't work:
    repeat
    io.write("Gissa ett nummer mellan 5 till 30 : ")
    Gissa = io.read()
    if
    Gissa = < 5
    then io.write("Bara nummer över 5!")
    until tonumber(Gissa) == 19

    • @aamird5760
      @aamird5760 8 ปีที่แล้ว +4

      leme learn lua

    • @sinisterrectus6010
      @sinisterrectus6010 8 ปีที่แล้ว +2

      You're mixing an if statement with a repeat loop.

    • @supertrol2042
      @supertrol2042 8 ปีที่แล้ว +1

      +TehPs7ch0 you forgot to end your if statement

    • @audiemurphy7421
      @audiemurphy7421 8 ปีที่แล้ว +1

      You forgot the end of your if statement.. otherwise the repeat is just fine so I don't know..

    • @hamsegamerxx1tv583
      @hamsegamerxx1tv583 8 ปีที่แล้ว +10

      Maybe because you need to type english

  • @prasannasilva7754
    @prasannasilva7754 3 ปีที่แล้ว

    This is the video that took me into the serious programming! thank you Sir! much love from Sri Lanka