Module Scripts - Roblox Advanced Scripting #11
BrawlDev · 4,095 words · 20 min read · EN-ORIG

Below is the complete, readable transcript of Module Scripts - Roblox Advanced Scripting #11 by BrawlDev on YouTube. Read the full text, copy any part you need, or generate a transcript for any video with our free tool.
you ever had those instances when you were writing scripts for your Roblox game and you pretty much had to reuse a lot of code that was from one script into the next let me show you something that I've written here so I have this function that I don't even know what the heck it does but let's say I wanted to
use this in a different script the only way I would be able to use this in let's say this script is I would literally have to take my function and I would have to paste it into my new script so that I can use this function inside of this script and not this one so this is
already a problem because duplicate code is never usually a good thing to have in your scripts because it could be very disorganized very quickly especially if your games become a lot more complex in the future we might even do the same thing with our third script here I would just copy and paste the same exact
function because there's no way we can access these functions outside of the script that the function was created in and not just functions but also variables that we want to access in other scripts and not just the one that it was created in this is pretty much where module scripts come in as part of
what we're going to be talking about in this episode to help us with this problem but before we start implementing these module scripts let's take a little bit of a deeper dive into what these module scripts actually are all right let's think about this for a minute so so far in our Roblox development Journey
we've been able to create scripts that run on the server and we've been able to create local scripts that run on the client also known as our player so these two types of scripts are very important but now we're going to be introduced to a third type of script called a module script so you might ask what the heck is
Transcribe another video
Paste any YouTube, Instagram or TikTok link to get a free transcript.