Roblox How to Script for Beginners | #14 | ModuleScripts

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024
  • This is the 14th video in this scripting series, and today I'm going to be covering ModuleScripts.
    A module script is a Lua source container that runs once and must return exactly one value. The most important thing that a ModuleScript does is allow you to adhere to the don't-repeat-yourself principle, or the DRY principle. This principle says that you should write code once and reuse it, rather than rewriting the same code over and over again.
    Some key points in this video are:
    1. Module Scripts don’t run by themselves
    2. A Script or LocalScript needs to require the ModuleScript for it to run, and it will only run once in each environment. Once on the server, and the once per client (again only if it was required by the server / client)
    3. The return statement needs to be the last thing in the Module Script
    4. Module Scripts can return anything, but they usually used to return tables
    Join the Discord to ask questions: / discord
    Read more about ModuleScripts:
    developer.robl...
    education.robl...

Комментарии • 31

  • @CyberCreator
    @CyberCreator  3 года назад +8

    Thanks! for watching! Join the Discord here: discord.gg/Mtf4KNY

  • @nathanolivera6651
    @nathanolivera6651 3 года назад +8

    Your the best RUclips for learning how we can script thank you

    • @CyberCreator
      @CyberCreator  3 года назад +1

      Glad you think so! Keep coding!

  • @lazypad6706
    @lazypad6706 3 года назад +4

    For a long time I had been searching for someone who actually explains Lua rather than how to use it for specific things like a door or moving parts. I’m glad you made this series, it is very helpful. I hope your channel experiences great success!

    • @CyberCreator
      @CyberCreator  3 года назад +1

      Glad it was helpful! Thanks for the kind feedback!

  • @ssubbu5930
    @ssubbu5930 3 года назад +5

    Bro I asked u months ago now I know all even delta time but anyway thanks

    • @CyberCreator
      @CyberCreator  3 года назад +1

      I wish I could have gotten it done sooner! I'm back on track now! I'm glad to hear you've been learning

  • @ultan6713
    @ultan6713 3 года назад +5

    Amazing tutorials man

  • @butnoyes_5778
    @butnoyes_5778 3 года назад +3

    Cool

  • @Vainglory100
    @Vainglory100 3 года назад +4

    Amazing video lol

  • @draken6497
    @draken6497 3 года назад +3

    continue the series please I'm begging lol

    • @CyberCreator
      @CyberCreator  3 года назад

      Soon! Maybe not exactly the series but videos that still build off it

  • @polygonfalcon163
    @polygonfalcon163 Год назад +1

    Whenever I print the table of a module script it shows the functions i put inside of it to

  • @memze1148
    @memze1148 2 года назад +1

    Thank you so much but what are threads tho??
    It been 2 year since you uploaded about lua

  • @Xanx1
    @Xanx1 3 года назад +1

    can you cover things like cframe, and things like that

  • @3mesh
    @3mesh 3 года назад +2

    Epik

  • @soapy5343
    @soapy5343 3 года назад +3

    Are their more comin?

    • @CyberCreator
      @CyberCreator  3 года назад +1

      Yes and no. I covered all of the "basics" for programming in general in that tutorial. You need to know how to use variables, functions, operators, loops, and data structures (tables) in order to program. Now that I've covered those, I will make standalone videos for different topics such as the different services. All of the standalone videos I make will use concepts I taught in the series. So it isn't abandoned, but it doesn't necessarily make sense to tag more videos on the end of the series sense they won't build on each other as much

  • @technically.provod
    @technically.provod 3 года назад +2

    I am 700 subscriber

  • @legomaster6919
    @legomaster6919 3 года назад +1

    Can variables work?

    • @CyberCreator
      @CyberCreator  3 года назад

      What do you mean?

    • @jaisonn25
      @jaisonn25 2 года назад

      @@CyberCreator can you access variable from the module scripts

  • @bibooo3585
    @bibooo3585 3 года назад +1

    this is so hard to understand lol

    • @bibooo3585
      @bibooo3585 3 года назад

      super underrated tho, i've seen tutorials on this from 200k subs youtubers and this one is the best series yet.

    • @OhStuma
      @OhStuma 3 года назад

      @@bibooo3585 same here man so hard to get going, different ways of doing stuff or the order people write code. and if u try find a code to do something u end up finding Multiple different codes all wrote differently to do the same thing lmao some are better than others or theres some better ways around things omg... but this guy explains it good . Honestly all of the Knowledge we need is on roblox website it tells u everything there is in the studio but its hard goodluck..

  • @redinternet9893
    @redinternet9893 3 года назад +1

    can i use "script.parent"in module script?