OOP in Roblox #4 - Metatables in Module Scripts

Ойындар

In the fourth video of Object Oriented Programming in Roblox, I talk about how to implement metatables into module scripts. This allows you to use the functionality of metatables between scripts using module scripts. This strategy makes your code more understandable and expandable.
Make sure to Like and Subscribe!
If you have any questions comment below!

Пікірлер: 37

  • @roch3586
    @roch35864 жыл бұрын

    You're not getting enough recognition man! You're helping me a ton!

  • @BRicey

    @BRicey

    4 жыл бұрын

    Thanks! I gotta grind really hard for the first few hundred subscribers... After that I think it should be easier. Thank you for telling me that I'm doing it right!

  • @PoppinCorn
    @PoppinCorn2 жыл бұрын

    This series has really helped broaden my understanding with metatables and better code optimization. awesome!

  • @BRicey

    @BRicey

    2 жыл бұрын

    Great to hear!

  • @kjanahan3776

    @kjanahan3776

    11 ай бұрын

    @@BRicey as soon as you mentioned abstraction you literally caused me to open my third eye

  • @Tyler-jd3ex
    @Tyler-jd3ex2 жыл бұрын

    Good tutorials! I was finally able to get that "click" moment. Metatables had me confused, and I couldn't find people that show the details that I want to know, but you went over it!

  • @abu0082
    @abu0082 Жыл бұрын

    Watching the entire series for the 100th time and now I finally understand object oriented programming.

  • @minerssp4363
    @minerssp43633 жыл бұрын

    My dreams of becoming professional scripter has come true :D Continue making script videos!

  • @user-du6sc8vl1t
    @user-du6sc8vl1t4 жыл бұрын

    Amazing youtuber no questions asked

  • @ThatGameGuyy
    @ThatGameGuyy4 жыл бұрын

    great video man!

  • @BRicey

    @BRicey

    4 жыл бұрын

    Appreciate it!

  • @justine.apostol
    @justine.apostol2 жыл бұрын

    Thank u so much dude

  • @Rayhero
    @Rayhero Жыл бұрын

    I don't really get any of this, why do we need 2 module scripts, why are we doing that? What is the metatable for? I'm very confused about this entire thing...

  • @conghoannguyen9927
    @conghoannguyen99272 жыл бұрын

    thanks so much for your series. I have a question is that is there any way to create a class which is inherited from 2 parents. Let's say I create class Vehicle then I create a Car class inheriting from Vehicle class. lastly, I create Mercedes class inheriting from Car. But I got nil value if I try to read Vehicle's properties from Mercedes class?? Please help me out if you have free time. Thanks a lot

  • @BRicey

    @BRicey

    2 жыл бұрын

    Since lua is such a flexible language, you can do that, but I would highly discourage it. What you suggest is called multiple inheritance, and it can lead to all sorts of problems.

  • @conghoannguyen9927

    @conghoannguyen9927

    2 жыл бұрын

    @@BRicey Thank you so much for your answer. I got some issues about it and you're right. The best way is using Composition. It would be easy to manage..^^

  • @nasrallahal-shaer8397
    @nasrallahal-shaer83972 жыл бұрын

    Hope you make a new game series using OOP and compositions, like fighting game, or maze game, smh like that

  • @BRicey

    @BRicey

    2 жыл бұрын

    I'm thinking about doing a maze game with rojo vscode, and OOP when I Have time

  • @nasrallahal-shaer8397

    @nasrallahal-shaer8397

    2 жыл бұрын

    @@BRicey Wow that would be very entertaining, hope you can do it soon before my 2nd year starts 😁❤

  • @funnyman4713
    @funnyman47133 жыл бұрын

    Im confused can you make a video on its perks? My code can be messy sometimes

  • @BRicey

    @BRicey

    3 жыл бұрын

    The Next Video of the OOP series talks about the pros and cons.

  • @PoppinCorn
    @PoppinCorn2 жыл бұрын

    oh, i have a quick question. let's say i were to change the "base.Number" to something more advanced like base.Monsters = { ["Goblin"] = { DMG = 5; HP = 7; }; }; let's say I were to index a monster that doesn't exist, but how would I create a default that would just return the goblin, instead?

  • @22bunnies34

    @22bunnies34

    2 жыл бұрын

    .__index is called when the index doesn't exist so do: metatable.__index = function() return base.Monsters["Goblin"] end)

  • @KevKevDawg

    @KevKevDawg

    4 ай бұрын

    @@22bunnies34i dont get where to out that

  • @rudy_vid4592
    @rudy_vid45923 жыл бұрын

    Quick question, what "episode" will we make our first tool, or first button or something like that?

  • @siddhapandeypanigrahi353
    @siddhapandeypanigrahi3532 жыл бұрын

    It is almost sad that this vid has only 102 likes right now.............

  • @user-du6sc8vl1t
    @user-du6sc8vl1t4 жыл бұрын

    Hey could you make a tutorial on how to save tables with DataStore2

  • @BRicey

    @BRicey

    4 жыл бұрын

    Ya I already do: kzread.info/dash/bejne/l4F_u9Odg9nVfdY.html

  • @user-du6sc8vl1t

    @user-du6sc8vl1t

    4 жыл бұрын

    @@BRicey thanks ill check it out!

  • @user-du6sc8vl1t
    @user-du6sc8vl1t4 жыл бұрын

    Is object oriented programming necessary to make good efficient functioning code?

  • @BRicey

    @BRicey

    4 жыл бұрын

    No, it is not. You can use whatever programming style you want! I personally prefer OOP over anything else as it is the standard for game design and although complicated at first (especially in lua), it is VERY powerful and clean to use. That is a great question!

  • @user-du6sc8vl1t

    @user-du6sc8vl1t

    4 жыл бұрын

    @@BRicey Thanks, Im trying to learn OOP since like most advanced scripters use it, also your tutorials are really helping me understand!

  • @BRicey

    @BRicey

    4 жыл бұрын

    @@user-du6sc8vl1t No problem, I'm glad you watch them.

  • @HaidarTheDev
    @HaidarTheDev8 ай бұрын

    Just use simple terms. My brain hurts 10 seconds into your videos lol

  • @CoolChris-vn8hz
    @CoolChris-vn8hz2 жыл бұрын

    I thought surely OOP would be easier in roblox than python, but ig not lol.

  • @BRicey

    @BRicey

    2 жыл бұрын

    Its way harder and more inconvienent since Lua is based on prototypes, not classes

  • @MR_NASC
    @MR_NASC2 жыл бұрын

    gay

Келесі