What are Module Scripts? Roblox Scripting Explained

Confused about module scripts? Look no further! This 8 minute primer explains what you need to know along with a few examples to get you up to speed.
DISCORD ► / discord
TWITTER ►@gnomecodeRBLX

Пікірлер: 234

  • @jsnotlout3312
    @jsnotlout33122 жыл бұрын

    As a dev who has tried to explain module scripts to people, You did an amazing job explaining it clearly and very understandably!

  • @GnomeCode

    @GnomeCode

    2 жыл бұрын

    That's great to hear, cheers

  • @user-N04H

    @user-N04H

    Жыл бұрын

    To you but not the average person trying to learn. I learned absolutely nothing from this. :/

  • @Sinz012

    @Sinz012

    Жыл бұрын

    @@user-N04H stop hating start learning 😂

  • @user-N04H

    @user-N04H

    Жыл бұрын

    @@Sinz012 not hating its just to the average person who's starting I have to know what these terms mean and they weren't the best for me. That's what im saying.

  • @RakisahNew

    @RakisahNew

    Жыл бұрын

    @@user-N04H this is advanced tutorial for people who have learned the basics, GnomeCode has a beginner scripting tutorial if you don't know the basics assuming the average person doesn't know the basics of scripting Hope this helps!

  • @kaitotties
    @kaitotties5 ай бұрын

    great sense of humour, well-paced and thoughtful, immensely helpful. thanks for your hard work, gnomecode!

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

    Excellent introduction; concise and straightforward without sacrificing detail. Thanks!

  • @kthuludev
    @kthuludev2 жыл бұрын

    almost a year of working on roblox game projects without getting into module scripts. this makes a lot of things clear, thank you gc your tutorials are very helpful and have been awesome!

  • @VodkaDoge

    @VodkaDoge

    7 ай бұрын

    same here, man, only difference is i dont make as many anime content as you

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

    This is one of the few tutorials i have actually learnt from, thank you so much!

  • @slingdev
    @slingdev10 ай бұрын

    Trying to just new learn skills that I might need in development, this one sure will help. Perfect teaching, thanks

  • @sir.potgreyscale3897
    @sir.potgreyscale3897 Жыл бұрын

    Thank you so much for teaching me! I've been always trying to find out how to use Module Scripts, but I was still confused. But after watching this video, I learned how to use module scripts well! (I SUBBED BTW)

  • @Kai29FR_
    @Kai29FR_8 ай бұрын

    Thank you so much, this tutorial is really easy to understand and you explained it so well! Keep going!

  • @Thelittlesthoboson
    @Thelittlesthoboson2 ай бұрын

    It seems as though you've taken a break from KZread or something, I'm not sure. I just found you today, but you are one of the best if not the best Roblox script tutorial makers for sure. You explain everything better than any teacher, and almost put things in storylines that make it fun and exciting in a way. Like your exploiting video where Billy goes on a rampage and you teach us how to tame him. I really would love to see you make a video about how to use Studio Explorer, IE, when to use Serverstorage, Serverscript Service, where to put things, where to never put things. As someone who is learning Roblox studio the biggest hurdle for me has been knowing when to use certain parts of the explorer, I found a video explaining it to some extent by another youtuber but he said some things like "Never use server storage, its useless" and a few other things that weren't entirely accurate. Basically, exploiters can ruin a lot of people's experiences, or flat out break games. I know they're supposedly rare and I should just focus on getting my game up and going but.. bleh. I just figure it would be easier to build it from the ground up knowing how to defeat the exploiters, rather than learning from losing players and getting dislikes because of them.. That's why I think you're such a huge value to the community, Nobody wants to play with exploiters, nobody wants exploiters to ruin the experience for their players, players have less fun, devs lose players, it's only a win for exploiters..

  • @SIMPLE_FORM
    @SIMPLE_FORM4 ай бұрын

    As I watched your videos,I see that your explanation is perfect,the things that I didn't understand with other,I got it by your explanations

  • @akiprox7
    @akiprox77 ай бұрын

    Thank you so much man! This will really help me organize scripts!

  • @feodorborisevich
    @feodorborisevich2 жыл бұрын

    Perfect introduction to module scripts. Many thanks

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

    This is so handy, thank you so much. The video was short, and you explained it so well.

  • @ItsPedro9898

    @ItsPedro9898

    2 ай бұрын

    I though it was boomsasok for 30 secs

  • @Abit_

    @Abit_

    Ай бұрын

    @@ItsPedro9898 j t o h

  • @PineBloxx
    @PineBloxx2 жыл бұрын

    I’ve been needing this for a long time. Thanks so much gnome!

  • @GnomeCode

    @GnomeCode

    2 жыл бұрын

    Great to hear!

  • @cinemalazare4850
    @cinemalazare48502 жыл бұрын

    as a begineer this is am thinking this is very useful for things like jumppads or killblocks maybe sword's or honestly anything. thanks i learned alot :)

  • @ricardo3201
    @ricardo32012 жыл бұрын

    Very Usefull for bigger projects! Thanks for making this video

  • @GnomeCode

    @GnomeCode

    2 жыл бұрын

    Thanks for the good vibes!

  • @poluefemus
    @poluefemus6 ай бұрын

    thanks man, best explanation i’ve seen

  • @amarondas-cm6rh
    @amarondas-cm6rh2 ай бұрын

    YO BRO TYSM! I FINNALY UNDERSTOOD WHAT MODULE SCRIPT NEED! TY

  • @xavierthefunny
    @xavierthefunny9 ай бұрын

    This is such an amazing tutorial, it's actually very good

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

    Best tutorial on Roblox Studio I have ever seen, thanks!

  • @tschesch6025
    @tschesch60252 жыл бұрын

    I‘ve been scripting for almost 2 years now and never bothered to learn about module scripts x) very helpful video, thanks lot

  • @juanfleury

    @juanfleury

    2 жыл бұрын

    I've been scripting for almost 2 year and I still don't understand what is it.

  • @saviornogame

    @saviornogame

    2 жыл бұрын

    @@juanfleury its basically just reusable code that any script can call so you only have to edit the original module once (its very useful for keeping information or having reusable functions)

  • @juanfleury

    @juanfleury

    2 жыл бұрын

    @@saviornogame I understand now, but thank you anyways :D

  • @cub0id

    @cub0id

    2 жыл бұрын

    same

  • @Yan-ol4qu

    @Yan-ol4qu

    2 жыл бұрын

    SAME

  • @rex5282
    @rex52822 жыл бұрын

    Fun stuff, knew what modules do but never knew you can use functions

  • @CheezyGaming0910
    @CheezyGaming09102 жыл бұрын

    That was so USEFUL!!! Thank you for helping me so much!!!

  • @ragingatrix9697
    @ragingatrix96979 ай бұрын

    This is a great tutorial. It really helped me a lot. Thanks 👍

  • @akiprox7
    @akiprox77 ай бұрын

    amazing man!

  • @wallop560
    @wallop5602 жыл бұрын

    These could defo be useful to beginners. Great job man!

  • @GnomeCode

    @GnomeCode

    2 жыл бұрын

    Glad you think so!

  • @dingus625
    @dingus6259 ай бұрын

    u explained this in the best way possible

  • @roliuu
    @roliuu3 ай бұрын

    Thanks, I use C++ mainly, and I'm glad there is something similar to classes and objects so I can work on my side project for fun. Though its not the same, since the objects are like created inside, kind of, like presets, but that'll do! I did mod Teardown ealier too, it uses lua for mods, but I never needed to go more complex

  • @BroJustCheese
    @BroJustCheese4 ай бұрын

    who dosent love this dude explaining stuff clearly

  • @therealsuper5828
    @therealsuper58282 жыл бұрын

    great tutorial! one thing i noticed with the SpawnFruit() function, is that you put the function in the same table as the fruits. SpawnFruit("SpawnFruit") will error, because further in the function it mentions fruit[name].Color (Color is not a member of a function)

  • @triggvfx5784

    @triggvfx5784

    2 жыл бұрын

    Dam That's crazy!

  • @pthwo

    @pthwo

    Жыл бұрын

    thats because you didnt set a color in

  • @terrymathsyt

    @terrymathsyt

    Жыл бұрын

    it worked for me

  • @reminderIknows

    @reminderIknows

    10 ай бұрын

    This comment is incorrect since you use [] when referencing something in a table fruit[name] references to the fruit being sent in a parameter for example fruit.SpawnFruit("Kiwi") instead of fruit[name], it will instead return Kiwi so Kiwi.Color = Color3.new(0.223529, 0.392157, 0.027451)

  • @therealsuper5828

    @therealsuper5828

    10 ай бұрын

    @@reminderIknows try it out, i know im correct about this

  • @epixerty
    @epixerty2 жыл бұрын

    I started scripting a bunch of months ago and I've been wondering what module scripts were, I haven't paid much attention to them, thanks for this video, now I will be able to use module scripts

  • @360sauce7

    @360sauce7

    2 жыл бұрын

    yeah

  • @raphaelrblx9102
    @raphaelrblx91022 жыл бұрын

    my brain focused so much in this and i learned a LOT

  • @mob1len00b3
    @mob1len00b310 ай бұрын

    bro this is so useful !

  • @jett27j30
    @jett27j30Ай бұрын

    I watched this a year ago, never thought I'd use module scripts, and here I am, watching it again because I need a module script for functionality.

  • @dunghuynh3884
    @dunghuynh38842 жыл бұрын

    People all need explain like this. Thanks for this video I subcribed

  • @GnomeCode

    @GnomeCode

    2 жыл бұрын

    Glad it helped, thanks for the sub!

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

    Your the best garden gnome

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

    Even though i dont really use these, im happy that know i understand them better, thank you

  • @BaldyDevRBLX
    @BaldyDevRBLX10 ай бұрын

    wow this is great, helped me alot managed to impethis into my game

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

    Hey thanks! I'm not really a good scripter but I wanted to know what this does so I'll know in the future!

  • @lightpin638
    @lightpin6382 жыл бұрын

    Yay a post!!

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

    Thank you for the tutorial👍

  • @PauloCosta-it2pv
    @PauloCosta-it2pv Жыл бұрын

    Amazing tutorial thank u!

  • @ShadowClaw_Dev
    @ShadowClaw_Dev2 жыл бұрын

    Thanks now I understand module scripts very well :)

  • @GnomeCode

    @GnomeCode

    2 жыл бұрын

    That's great to hear!

  • @Jappley
    @Jappley8 ай бұрын

    i love how he says "lilcal script" for local script lol

  • @grandeurgaming2165
    @grandeurgaming21652 жыл бұрын

    Yes please do on OOP. I would love to watch it.

  • @CT_Gree
    @CT_Gree2 жыл бұрын

    for the example shown at 3:20 or so, you can just do: return { ["Apple"] = { Price = 50, } }

  • @itsnotAZ
    @itsnotAZ2 жыл бұрын

    Thanks!I abondoned a HUGE amount of projects since the code was messy...! If I only knew...

  • @QUBIQUBED

    @QUBIQUBED

    Жыл бұрын

    Try making smaller projects or work on a friend’s project for a while to learn organizing code better

  • @itsnotAZ

    @itsnotAZ

    Жыл бұрын

    @@QUBIQUBED Unfortunately, I'm not into roblox game dev anymore. I have moved on to other larger game engines, which i think your advice still applies. I will take it into consideration next time I work on a project.

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

    This video helped me a lot!

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

    Amazing Tutorial!!!

  • @edufabricio
    @edufabricio7 ай бұрын

    Is the Module similar to a Class in OOP ? i got it. Nice and very clearly explanation 🙌

  • @MCAsh-il9cq
    @MCAsh-il9cq2 жыл бұрын

    Are you going to do videos on how you changed the teddy ai or building chapter 4???

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

    Wow I code on roblox, this will help me make my scripts not so long! Thx so much! 😍

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

    Great tutorial!

  • @deadbrav
    @deadbrav11 ай бұрын

    Fun fact: module scripts are very useful when making programming languages

  • @markhorst-uy1sm
    @markhorst-uy1sm Жыл бұрын

    So helpful!

  • @sussbob
    @sussbob2 жыл бұрын

    Can you make a tutorial on how to make a morph menu screen (like a gui or a menu) with a list of options to morph into (creatures or animals not robloxian parts) and when you click it. You morph into it? Then make the menu for morphing disappear unless you respawn. I wanna make a monster battler game This Is something that had been very high requested for a very long time but nobody made a tutorial for it

  • @ThatOneGuyInTheStore
    @ThatOneGuyInTheStore4 ай бұрын

    Thank you man! H, Verry cool.

  • @BirdyKongy
    @BirdyKongy2 жыл бұрын

    can i ask does module script can be also used in normal script like u can do what its does inside script but module script just help u to keep scriptings more organized and u can just check if the script says what it does and makes it simple and easy to look at? if its just for that then i understand i take it that u problly can use at normal script but just when ur working on big project like jailbreak and lots of updates game will be using this ? well if thaats the case i learned alot thx for sharing!

  • @seeray11
    @seeray114 ай бұрын

    Could you replace the “name” in the function in the module script with whatever. I didn’t get that part. How does name mean name, since I couldn’t find anywhere in the script that makes the name mean name. I thought it just meant fruit.SpawnFruit, which doesn’t mean anything until you assign a function to it.

  • @blockboy8048
    @blockboy80482 жыл бұрын

    Yes new video

  • @Skroopz
    @SkroopzАй бұрын

    thanks i never knew what module scripts are now inknoe

  • @DontLookAtThisPleaseThankYou
    @DontLookAtThisPleaseThankYou10 ай бұрын

    Gnome code doesn’t need the toolbox, the toolbox needs him.

  • @WearWolf98
    @WearWolf982 жыл бұрын

    and could you do a video of effect like beam explosion effect smoke it could be useful for me or the comunity thanks

  • @ChristopherThePiss
    @ChristopherThePiss2 жыл бұрын

    Already know but it was still cool to get a recap

  • @nottony5200
    @nottony52002 жыл бұрын

    Wish when I was learning scripting this video existed

  • @user-bp2rt9ou8z
    @user-bp2rt9ou8z10 ай бұрын

    as a developer and a exploiter this information is useful for backdoors

  • @chddrchmze
    @chddrchmze2 жыл бұрын

    Me, making an RPG with a core folder half comprised of module scripts plus 2 module scripts for each and every kind of monster except bosses: "ORGANIZATION 100"

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

    G’Nome!

  • @markojotovic8991
    @markojotovic89912 ай бұрын

    wow its could be super usefull ,remind me of Json or Objects in JS

  • @HowToName559
    @HowToName5592 жыл бұрын

    Hey! GnomeCode why i can edit teddy game?

  • @ardatimeofc
    @ardatimeofc6 ай бұрын

    Can I use module scripts to make like a chance percentage on egg hatching system?

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

    So... it's kinda like the reason why you want a separate file for all of your CSS in html

  • @dvm1126
    @dvm11262 жыл бұрын

    nice outro!

  • @GnomeCode

    @GnomeCode

    2 жыл бұрын

    Cheers

  • @yelezi7950
    @yelezi79502 жыл бұрын

    Your next video should be about anti-exploit scripts.

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

    Excelente!!

  • @dangerr_xlmao1317
    @dangerr_xlmao13177 ай бұрын

    i use modulescripts to make portable GUIs like a portable serverside executor or a gui to nuke people where i just do something like this to make it(simplified version of my nuke gui): (varibles blah blah blah like repl storage) local module = {} function module:GUI(plr) local gui = script.ScreenGui:Clone gui.Parent = players:FindFirstChild(plr).PlayerGui (players here is Players service that is defined in variables) end return module

  • @AnshumanPareek1
    @AnshumanPareek12 жыл бұрын

    Hi, I am making a game like CS:GO surf in Roblox and, I want to make part that when touched increased the player speed every second and when player dies it resets automatically and speed is also show with the help of GUI on player screen. (The speed should only increase for the player who touches it.) Please help me. I am stucked.😥😥😥

  • @planeman4453
    @planeman44532 жыл бұрын

    Nice video, any chance you could do a video in utilising them in a game? I'm trying to make a survival game, and I'm using module scripts, but I have problem. I have an inventory module which needs to have a 2 way communication with my hotbar module, but I can't have that. Would I need to merge the modules into one big one?

  • @zwwz1424

    @zwwz1424

    2 жыл бұрын

    never merge modules together, it's not necessary in 99.9% of the cases modules are there to organize code and support reuseability

  • @planeman4453

    @planeman4453

    2 жыл бұрын

    @@zwwz1424 yeah, but I can't make it work otherwise. I need both modules to require each other, which causes an error.

  • @zwwz1424

    @zwwz1424

    2 жыл бұрын

    @@planeman4453 put the functions you need from both modules in a different one if possible

  • @planeman4453

    @planeman4453

    2 жыл бұрын

    @@zwwz1424 i can't. That defeats the whole point of having them as 2 modules. Should i just merge the hotbar with the inventory then (modules)?

  • @zwwz1424

    @zwwz1424

    2 жыл бұрын

    @@planeman4453 i guess yeah

  • @user-wt3sm7rb4b
    @user-wt3sm7rb4b6 ай бұрын

    Can you edit a player gui inside of a module script?

  • @jbplays99
    @jbplays992 жыл бұрын

    I never knew how to use a modulescript until now...

  • @sealsnatch
    @sealsnatch6 ай бұрын

    Most of my coding knowledge is in c#, are these like classes?

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

    very nice video

  • @mrcatwhoscripts4443
    @mrcatwhoscripts44432 жыл бұрын

    Thank you

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

    how could i add more/modify variables in a module script using other scripts?

  • @VodkaDoge
    @VodkaDoge7 ай бұрын

    i have a feeling this will expand my journey into game making, also, tiny question for experienced devs. Let's say I want a lot of blocks to share the same script! Print "Touched" when a player touches them. Will it work to just put them all in the same folder, make a moduleScript inside that folder that has the actual printing script, and have server scripts that require the moduleScripts? Example: ModuleScript: [Code to detect touch and print message] Script: require(BlockFolder.ModuleScript) edit: Yeah, you can. Did it by myself after like 15 minutes.

  • @coolbudYT

    @coolbudYT

    5 ай бұрын

    I mean I don't think doing modules would be great for it but you can use loops👍

  • @VodkaDoge

    @VodkaDoge

    5 ай бұрын

    @@coolbudYT nah, worked perfectly. better than anything else, if you want i can share the code

  • @user-tp9ux4xs7q

    @user-tp9ux4xs7q

    5 ай бұрын

    u can just put all parts into one folder, then use for _,v in pairs(folder:GetChildren()) and v.Touched:Connect(function()

  • @VodkaDoge

    @VodkaDoge

    5 ай бұрын

    @@user-tp9ux4xs7q that's overcomplicated ngl, there's a much simpler and compact way, as i said, i'll gladly share the code

  • @Dave_15_roblox
    @Dave_15_roblox4 ай бұрын

    Can someone explain why i got a module congfig manager Warning??

  • @Krantworld
    @Krantworld6 ай бұрын

    It's make changes in the Sarver or claint?

  • @xlubir1569
    @xlubir15695 ай бұрын

    Good Video😃

  • @szc113
    @szc1139 ай бұрын

    Well, he clearly said that tomatoes are not fruits

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

    How do I turn someone into another character using a model script?

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

    Im extremely annoyed by Module scripts. Everytime I add a Module Script into a Script or also try to seperate them, everything I type into the Module Script the Script will just copy it. Same way around. And if I delete everything in the Module Script, the Script will also delete everything.

  • @rfsalt
    @rfsalt10 ай бұрын

    Thanks

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

    so basically modulescripts are functions except in physical forms ?

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

    damn now i know thank you very much i susscrcribe you now

  • @Mufazl2120
    @Mufazl212011 ай бұрын

    Thank you, I really understand now🎉

  • @Dingo-
    @Dingo-2 жыл бұрын

    Request: can you make a tutorial of how you can make a storyline to the 2d platformer

  • @stefotheguy2766

    @stefotheguy2766

    2 жыл бұрын

    How can he teach you that?

  • @gabrielc7861

    @gabrielc7861

    2 жыл бұрын

    That's not code, go get writing tips.

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

    the fruit dictionary made me forget basic scripting

  • @templars44
    @templars442 жыл бұрын

    Very cool

  • @HurelyDev
    @HurelyDev2 жыл бұрын

    I have idea for Teddy, a season pass!

  • @themadone3253
    @themadone32532 жыл бұрын

    module script is like arrays in c sharp , php and many languages.