Metatables - Roblox Scripting Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024
  • Discord: / discord
    Patreon: / suphi
    Donate: www.roblox.com...
    In this video i will be showing you how metatables work
    developer.robl...
    lua-users.org/w...
    lua-users.org/w...

ความคิดเห็น • 54

  • @heetman5925
    @heetman5925 ปีที่แล้ว +30

    I have been struggling to understand this for a long time now. Regardless of how much scrutiny and focus I had put into other videos teaching this same lesson I would always fail to even grasp a loose understanding. I watched this video and something about it just made me learn this easily. The problem for me was to understand the logic in the code. Thank you!

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

    Been scripting for a while but I'm definitely learning a bunch of new stuff from your videos. Glad I stumbled across your channel

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

    Great content! My into to tables as a whole has been a headache and that clears up a lot of questions as well as gives me many ideas on how to improve my current projects

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

    Gotta say, your videos make me understand roblox scripting very well. They are top-tier tutorials for people like me

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

    First time i watched this, i didnt understand. A week later, i watched it again, and i now fully understand! I dont know how, but this channel is really great and helpful. Keep going!

  • @BlueBee4179
    @BlueBee4179 8 หลายเดือนก่อน +2

    Nah, This video is way too good, I can not hold it any longer 😭

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

    i have been scripting for 2 years and i did not know you could do things like that.
    i will defenitely use it now

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

      yeah well, you never try to push your limits, you only stick to stuff that you already know.

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

    thank you for this video it really helped me understand metatables more than other videos

    • @5uphi
      @5uphi  11 หลายเดือนก่อน

      :)

  • @desicape
    @desicape หลายเดือนก่อน +1

    god bless u, thanks bro i finally understand this!!!

  • @로좋
    @로좋 5 หลายเดือนก่อน

    Finally i can understand this, thank you so much!!!

  • @GiThom-j2p
    @GiThom-j2p 2 หลายเดือนก่อน +1

    For the equals function why not do return t.x == v.x and t.y == v.y?

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

      That is also a valid option you could do

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

    Thx For The Amazing Video 🍬🍬

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

    Great video

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

    This is the only video that make me understand how it work
    Tho I don't know when will you use this?

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

      It's another tool in your toolbox 🧰

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

      @@5uphiYe, imagine your are roblox engineer, you were making a new roblox function.. idk if im right.

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

    Thank you so much this is very helpful but I have some questions:
    1- How the tables can be different(but they are the same)? 21:25
    2- How can vectorA and vectorB take the same location in memory while doing vectorB inside of vectorA doesn't? (is it because of the way we're doing it?)

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

      They are different tables but their metatables are the same so they both are in different locations in memory but the metatable is in the same location in memory

  • @Fact-Point
    @Fact-Point 2 ปีที่แล้ว +1

    Quite a strange thing to ask here, but would you be interested in scripting with us, we are working on a very unique dark fantasy souls-like game while striving for industry-standard technology usage and practices.

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

      Message me at discord

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

    4:25 saving a spot dont mind me!!!

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

    What is the different between . And : when calling a function in module

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

      one passing the value one does not
      Value.Func(Value) is the same as Value:Func()

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

      @@5uphi thank you suphi 😁😁😁

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

    Besides __index, __newindex, __len and maybe __metatable, why would i use the other ones other than make it look fancy

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

      why would you try to make your code look fancy?

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

    I've seen some modules do t = {} t.__index = t What is the point of setting a table's index metamethod to itself?

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

      17:18

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

    Jesus amado! Muito avançado pra mim! :(

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

    It seems all you did is some coding. You need to explain what you are doing instead of showing results

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

      Thank you for your feedback and I'll try to improve for future videos metatables are a little difficult to describe because you can't really find anything like them in the natural world there a bit like trying to describe the 4th dimension and as this video was more designed for experienced scripters I did not cover the basics of what I was doing in order to not make the video any longer then it needs to be

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

      @@5uphi Sorry if I was a bit rude. I get worked up about things that are really hard to do. But I think people that would need a tutorial would also need the basics. If it makes the video longer, it is just because there is a lot of content to be made on it.

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

      It's hard to please everyone I also get complaints from the other side that I'm explaining the basics so I try to target some videos for beginners and some for more advanced scripters based on the topic I'm covering I would recommend having a good understanding of how tables work before moving onto metatables

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

      @@5uphi I guess you should just make a beginners tutorial and a non explanatory tutorial? idk seems tough

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

      @@TurdleRoblox You shouldn't really be watching this if you are a beginner though

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

    dude i dont get it

    • @5uphi
      @5uphi  11 หลายเดือนก่อน

      Maybe you should first try to understand other topics before moving onto metatables because they do require you to have a good understanding of other things like tables etc...
      But technically it's my failure as a teacher because it's my job to make sure you understand but I have failed sorry

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

      @@5uphi dude I am a really good scripter maybe its my fault i do know about tables table.insert table.remove everything other but like this object oriented script and metatable stuff i dont get, i forgot*

    • @5uphi
      @5uphi  11 หลายเดือนก่อน

      Think of metatables like settings for a table it allows you to configure how tables work

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

    I still understand jack shit
    I DONT FUCKING UNDERSTAND ANY OF THIS

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

      ¯\_(ツ)_/¯

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

    Suggestion:
    If you want an updated magnitude:
    Instead of update it every meta method operation
    just use __newindex when magnitude is called and return the result operation

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

      vectors in Roblox never change so the magnitude only needs to be calculated once when the vector is first created