How To Use ModuleScripts In Roblox Studio - Advanced Tutorial #1

Тәжірибелік нұсқаулар және стиль

Learn how to use module scripts on Roblox Studio with this Roblox scripting tutorial. Module Scripts allow you to call functions from different scripts and organise your code. I also go over the _G variable and why you should not use it.
Beginner Scripting Series: • Roblox How To Code - H...
Written guide: devforum.roblox.com/t/how-to-...
Support my work by becoming a Channel Member using the link below:
► / @alvinblox
Subscribe to my KZread channel for more scripting videos:
►kzread.info?sub...
► Watch my full beginner scripting series: goo.gl/k3erz2
Got video suggestions or feedback? Contact me via my website
►www.alvinblox.com/
Roblox username: Alvin_Blox
The music in this video is licensed from Epidemic Sound
www.epidemicsound.com
#ModuleScripts #RobloxScriptingTutorials

Пікірлер: 627

  • @MatteoP04ita
    @MatteoP04ita4 жыл бұрын

    Every time i start your videos, my Google Assistant thinks you say "Hey Google"

  • @EternalPolaris
    @EternalPolaris4 жыл бұрын

    This is what i was needing for a script in my game. Thanks for making this tutorial :)

  • @dontlookatmyvideoREE
    @dontlookatmyvideoREE4 жыл бұрын

    Scripting is like math for me, it's fun when you know about it but it's hard and frustating when you dont know about it and this leds me hating it and trying to ignore it.

  • @CombinedHawk2555

    @CombinedHawk2555

    3 жыл бұрын

    learn math.random

  • @hydraulicfacechannel2147

    @hydraulicfacechannel2147

    3 жыл бұрын

    on spot comparison

  • @Blergph

    @Blergph

    3 жыл бұрын

    Math also is different than scripting, for math you solve problems to solve problems, for scripting you script to make cool stuff

  • @freevipservers

    @freevipservers

    3 жыл бұрын

    @@Blergph No, well yeah but you can use scripting to solve math problems or other things to.

  • @Bruno-yf9yh

    @Bruno-yf9yh

    3 жыл бұрын

    Yes exactly. When you know Math it's so esy but when you don't know is hard. The more you know the more you learn xD

  • @Xodack5
    @Xodack54 жыл бұрын

    I've been looking for a tutorial like this for a while now. I really appreciate it and keep up the good work!

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

    metatables would be cool to see in this series!

  • @memedatabase6146

    @memedatabase6146

    4 жыл бұрын

    Too easy

  • @williamlarsen3733

    @williamlarsen3733

    4 жыл бұрын

    Mahdi Ahmed it’s not easy

  • @awaist

    @awaist

    4 жыл бұрын

    what are metatables

  • @vigneshvijayan394

    @vigneshvijayan394

    3 жыл бұрын

    I have seen this comment is some other vids too

  • @Boss-cv3uc

    @Boss-cv3uc

    3 жыл бұрын

    @@memedatabase6146 The whole purpose of AlvinBlox posting these videos is to *teach* people about Roblox Lua. It wouldn't make sense to only post things that are hard and forget about the 'easy' stuff ... That would defeat the whole purpose of an educational channel.

  • @Redcodes
    @Redcodes4 жыл бұрын

    Thank you for starting the Advanced Series!!!

  • @AlvinBlox

    @AlvinBlox

    4 жыл бұрын

    Hope you enjoy it!

  • @GamingProNPC

    @GamingProNPC

    3 жыл бұрын

    @@AlvinBlox Thx Alvin!!

  • @CADEATERTOP3248

    @CADEATERTOP3248

    2 жыл бұрын

    @@AlvinBlox thanks a ton

  • @thetrickyitch7179
    @thetrickyitch71794 жыл бұрын

    Oh man; I'm so thrilled. I have been asking for this one recently. I've been struggling with the documentation and other online explanations and really needed AB's take. I'm neck deep in development on my second game, and it's largely hard-coded. Very much appreciated.

  • @gianmarco2712
    @gianmarco27122 жыл бұрын

    This is really helpful for organizing code. for example; Admin Commands. Admin commands can get really messy when doing to commands themselves, the difference module scripts do is make less lines of code on 1 script, its not only this change, it changes the vision too. You will no longer have to scroll all the way down to find the system itself.

  • @trapmusic8343
    @trapmusic83434 жыл бұрын

    Omg thanks Alvin for doing these series again, been waiting for advanced script tutorials for a while, i already watched all your beginner scripting tutorials ❤

  • @jakeharper6167
    @jakeharper61673 жыл бұрын

    I just have to say, thank you for taking the time to make these, i started watching thedevkings tutorials and learned like the basics but i felt like i truly wasn't learning anything because he wasn't vividly explaining enough how things work and just expects us to "know" what they mean. Like for instance on his module scripts video, he didn't tell us we could call for modules from scripts OR put functions in modulescripts.. you're making the process of creating my first game more and more possible from each video, and i thank you dearly for that.

  • @DevZoid
    @DevZoid4 жыл бұрын

    Hey Alvin, thanks so much, you've helped me improve my scripting abilities so much over the past few years! Congrats on 200k btw!

  • @computerprogrammer7942
    @computerprogrammer79423 жыл бұрын

    Module Scripts are kinda like object oriented programming, any script aka server script and local script can use them; they can be reused as many times you would like; They are very good for remote functions and you are passing arguments through

  • @reigninbloodaraya
    @reigninbloodaraya4 жыл бұрын

    Oh my gosh. Congratulations on the 200k Subscribers!! I am so exceited to watch this. Just wanna say that, ive been here at 50k Good job alvin

  • @AlvinBlox

    @AlvinBlox

    4 жыл бұрын

    Thank you so much!!

  • @ragusan2536
    @ragusan25364 жыл бұрын

    WOW, this helped me out A LOT, I would not have understood this if it was not for your beginner scripting series, thank you for everything you do, without your scripting tutorials, I might not have been able to use it in situations where I need it the most and would have definitely not been where I am today

  • @auxiliaryplays4804
    @auxiliaryplays48044 жыл бұрын

    Yes, It’s FINALLY here! This video helped a lot, I used to be very confused on What a Module script does, so this helps!

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

    Im so happy, for almost a year ive been trying to learn lua and everytime i gave up untill i watched your tutorials, youre amazing and im so so grateful, Thank you

  • @nam9505
    @nam95054 жыл бұрын

    Just started watching Alvin again after 3 years and I gotta say Puberty did you good, wowie

  • @jetupny6260
    @jetupny62603 жыл бұрын

    Your voice got a lot deeper Alvin and your style has changed over the years! Keep up the good work!

  • @gustassimanavicius6871
    @gustassimanavicius68713 жыл бұрын

    First of all, it was very helpful. Next of all. Learning to script is a bit hard, but learning to module script is harder than I tought. I do like your scripting tutorials.

  • @HHWELLER
    @HHWELLER4 жыл бұрын

    Wow I was asleep when this was published Your great Alvin!!

  • @ratosthing8858
    @ratosthing88583 жыл бұрын

    This is so helpful! I wanted to make a game with abilities but I had trouble with making the abilities work in the first place, I hope this can allow me to bring ability data over to the player script to run it more clean and organized.

  • @daguy2850
    @daguy28504 жыл бұрын

    Perfect time to come out with this tutorial for me. I was just about to try and experiment with some module scripts in my game and this really helps a lot!

  • @superstorm4228
    @superstorm42284 жыл бұрын

    Thank god for this video, I was using module scripts completely wrong. No wonder I couldn't call my modules scripts from the main script. Thanks for the video!

  • @justinbusari7975
    @justinbusari79754 жыл бұрын

    So happy u started the advanced series

  • @w4lroo
    @w4lroo4 жыл бұрын

    Finally. I’ve been stuck for I while not really learning much although I do know how to script well, but I hope this series helps me.

  • @notsofakenews2844
    @notsofakenews28443 жыл бұрын

    Every episode is new and unique and im always learning new and efficient ways to script before I begin my MainGameScript!

  • @PablitotheChicken
    @PablitotheChicken4 жыл бұрын

    This legit saved my whole game. My scripts were so messy. Now i can finally see what i wrote

  • @spicybbqchicken

    @spicybbqchicken

    3 жыл бұрын

    what game? i'll play it

  • @pavlova3310

    @pavlova3310

    2 жыл бұрын

    yes pls send link

  • @NovaPlayz2
    @NovaPlayz22 жыл бұрын

    I’m half way through and this is incredible! I never knew I needed this but now I’m actually understand!

  • @Roro_Studios
    @Roro_Studios4 жыл бұрын

    Nice video! I was a little confused with ModuleScripts before, but I get them now :D

  • @devilking8869
    @devilking88694 жыл бұрын

    Hi Alvin.. I used to watch your videos when I was a Roblox Player. But Now I am learning Coding so Now I can understand your videos more. Thanks

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

    Thank you this helped me better ynderstand module scripts, i didnt really understand what they do and how they work so this tutorial helped me, thanks alvin!

  • @jtytgaming4585
    @jtytgaming45854 жыл бұрын

    Thanks for making these series your actually helping my scripting skills get better!

  • @AlvinBlox

    @AlvinBlox

    4 жыл бұрын

    Happy to help!

  • @haxis3764
    @haxis37644 жыл бұрын

    Wow this is really clear im learning well done

  • @iggydeveloper
    @iggydeveloper4 жыл бұрын

    Hi AlvinBlox, even dough this' a advanced scripting tutorial you explain things very well that I think that for people that are new to scripting in roblox even can understand it, really good tutorial!

  • @vvs.on.laptop
    @vvs.on.laptop Жыл бұрын

    Absolutly Brilliant Tutorial! Definetly watching the rest! 👍

  • @technoholic5189
    @technoholic51894 жыл бұрын

    How long will it take for the next episodes? I already can't wait! You have done beginners tutorials twice, now is the time for advanced scripting tutorials :)

  • @thebbdtrio8936
    @thebbdtrio89362 жыл бұрын

    This was really helpful, The analogy was a really helped me understand everything a lot better. Thank you!

  • @notsofakenews2844
    @notsofakenews28443 жыл бұрын

    just finished the beginner series. Now its getting advanced. This will be fun! I like hard stuff :)

  • @duckytristan2451
    @duckytristan24514 жыл бұрын

    I was looking for these tutorials from you (the advanced scripting tutorials) :D

  • @flxqra4107
    @flxqra41074 жыл бұрын

    Awesome Alvin! Thanks so much! :D have a great day!

  • @ThatTexan2002
    @ThatTexan20024 жыл бұрын

    Ur doing a great job alvin keep it up bud

  • @jaysallbedi
    @jaysallbedi4 жыл бұрын

    Thank you so much AlvinBlox really wanted this tutorial and yeah waiting for Piggy Shop Tutorial too! 😀

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

    I finally know how to use module scripts now thanks Alvin!

  • @lightflow6990
    @lightflow69904 жыл бұрын

    Thanks you so much With out the tutorials I had no idea what to do and I was unmotivated So I nearly stopped and gave up now I can learn again!

  • @epikboi1617
    @epikboi16174 жыл бұрын

    This is super useful. Thanks Alvin.

  • @gorb2518
    @gorb25184 жыл бұрын

    I have been waiting for this.

  • @xDarkRegionx
    @xDarkRegionx4 жыл бұрын

    You never made how to tween guis but I'm happy I learnt it, thank you for this tutorial :)

  • @nil7460
    @nil74604 жыл бұрын

    hi alvinblox! thanks for this video!!

  • @jasper2469
    @jasper24694 жыл бұрын

    Pls next episode: save and change properties of an object permanently real-time, and even if the server shuts down

  • @devingwithlowgonman5332

    @devingwithlowgonman5332

    4 жыл бұрын

    You can use DataStoreService to save a change to it

  • @haxis3764

    @haxis3764

    4 жыл бұрын

    hmmmmmmmmmmmmmmmmmmmmmmmmm yeah that sounds pretty good

  • @xumichael3090

    @xumichael3090

    4 жыл бұрын

    There is something called datastore

  • @pplayer3187

    @pplayer3187

    3 жыл бұрын

    u can try data store sercice

  • @noahnation331

    @noahnation331

    3 жыл бұрын

    Datastore every 20-60 seconds

  • @embry6883
    @embry68833 жыл бұрын

    I never thought this would be useful. But Today it was, Thank you alvin!

  • @lukkan4131
    @lukkan41314 жыл бұрын

    Woop Woop finally advanced tutorials, btw I have always wondered how to use module scripts

  • @cocodevs
    @cocodevs4 жыл бұрын

    Thank you! I've been looking for a tutorial on Module Scripts! I've been coding since about late 2017 or early 2018 (even bought some books) but could never find out how to use module scripts!

  • @eisathefirst
    @eisathefirst4 жыл бұрын

    TYSM ALVIN YOU ARE SO HELPFUL!!!

  • @safi3968
    @safi39684 жыл бұрын

    This is what I asked for on stream :)

  • @coznix
    @coznix3 жыл бұрын

    this is actually so unbelievably useful thank you so much

  • @CoolDude0x
    @CoolDude0x4 жыл бұрын

    Love it! Contiune making these good videos!!

  • @tohieucuong7053
    @tohieucuong70534 жыл бұрын

    YAY, A NEW MODULE SCRIPTS TUTORIAL :D

  • @gunterjudd5406
    @gunterjudd54064 жыл бұрын

    Alvin I'm trying to make a game for everyone to play and your videos have help me, Thank you so very much -plus I love your vids

  • @originalnick473
    @originalnick4734 жыл бұрын

    Hey Alvin, thanks a lot for this video. I trying to get into OOP and I heard that Module Scripts are good for it, so I really want to learn how to use them!

  • @GreenXDXD
    @GreenXDXD4 жыл бұрын

    Pretty helpful alvin. Im making a game then suddenly this video appeared. I can use this script. Thx dude Btw congratz for 200k subs

  • @pepethejoker8809
    @pepethejoker88094 жыл бұрын

    Finally, you've made another tutorial, thanks dude! :V

  • @brangardia3823
    @brangardia38234 жыл бұрын

    Hey! Love your videos!

  • @jackuk2700
    @jackuk27004 жыл бұрын

    Hey Alvin! I’m starting to get the hang of scripting but I think you need to do a few more tutorials, and I know you need suggestions so here you go! First suggestion: Do some Player tutorials, so if you wanted to a gui buttons with all the players in the game with their names on, how would you do it? And once they leave to get rid of that gui button! Second suggestion: Do a camera tutorial, so if we wanted to make a cutscene or change a camera angle for 1 player when they hit a button or for all players at a certain time, how would we do that? Lastly: If we wanted to do a random function at a random time, how would we do that? Just some suggestions, thank you for reading

  • @mixu_78

    @mixu_78

    4 жыл бұрын

    Gui buttons with player names on them: For each player in Players:GetPlayers() make a new guibutton and preferably parent it to a frame with an uilistlayout or other layout of choice, and store the button in a table like {[playeruserid] = guibutton}. Then when a player is removed look up their button from the table and :Destroy() it. When a player is added create new button, set the players userid to their button in the table of userids and buttons, and parent it to the place where you want the button to be. Random function at random time: Have a table of functions, wait math.random(min, max), then call a function in the table with functiontable[math.random(min, max)](). Add arguments into the () brackets, eg functiontable[1](argument1).

  • @Adam-vx5tt
    @Adam-vx5tt4 жыл бұрын

    OMG FINALLY A TUTORIAL ON MODULES!

  • @w1shudabe
    @w1shudabe4 жыл бұрын

    I always enjoy getting the notification seeing that you've uploaded!

  • @TumbleWede
    @TumbleWede4 жыл бұрын

    Keep the good tutorials going!

  • @kingfred9
    @kingfred94 жыл бұрын

    Hello! Nice video series

  • @lightleviathan1
    @lightleviathan14 жыл бұрын

    Heck yes this is awesome btw congrats on 200000 subs!

  • @AlvinBlox

    @AlvinBlox

    4 жыл бұрын

    Thank you so much!!

  • @anne9894
    @anne98944 жыл бұрын

    This Video Is A Masterpiece, i Love it:D

  • @Swoz69
    @Swoz694 жыл бұрын

    i just made my own loadingscreen modulescript and its so easy to just get the module and use it, ty :)

  • @F1FTY_rblx
    @F1FTY_rblx4 жыл бұрын

    Early!! :D Love your videos

  • @dovias5665
    @dovias56652 жыл бұрын

    For c/c++/java folks ModuleScript is a translatable unit which can be imported into another unit.

  • @Knineteen19
    @Knineteen193 жыл бұрын

    xD watching with the auto-generated subtitles is amazing. It gets most of it right, but every time you say module script it says random stuff and gets increasingly further away from module script like "model script" at one point, "mortal script" at 13:19, and then it gets even better. It's not even English anymore and it thinks you said "otaru script" at 26:32. Great video though. I've been looking for a more in-depth tutorial on mortal-I mean module scripts since I knew the basics, but I didn't *really* understand how it all came together until this video.

  • @nabilarmouch6107
    @nabilarmouch61074 жыл бұрын

    You are amazing alvin

  • @nlaps
    @nlaps4 жыл бұрын

    YAY! I ASKED FOR THIS!!

  • @arenzion6952
    @arenzion69524 жыл бұрын

    Alvin I hopeeee you go on with this. Please like you had a beginner scripting series, you can do this advanced series, then a professional series

  • @AlvinBlox
    @AlvinBlox4 жыл бұрын

    Don't worry, Piggy shop tutorial is still coming soon, I just haven't finished it yet. My Beginner Series is here: kzread.info/dash/bejne/dJqAt9Zsncmwmbw.html Written Guide Text Tutorial: devforum.roblox.com/t/how-to-use-module-scripts/572047

  • @challing1389

    @challing1389

    4 жыл бұрын

    First reply

  • @TotallyNotBrisko

    @TotallyNotBrisko

    4 жыл бұрын

    Finally, another upload.. I’ve been waiting for ages. Not dramatic, I swear.

  • @InfinitePlayzD

    @InfinitePlayzD

    4 жыл бұрын

    AlvinBlox Ok thanks. And also Idk why but my game works but It only works once or twice then stops. I did do a While wait() do. And could you please add a spectate gui

  • @THEKING-xk6vs

    @THEKING-xk6vs

    4 жыл бұрын

    How do I make a skip stage dev product if my team names are the names of brick colors?

  • @MadGermanX_X

    @MadGermanX_X

    4 жыл бұрын

    I am really happy That you are making does Series

  • @appius1178
    @appius11784 жыл бұрын

    YAY A KNEW ALVIN BLOX VIDEO

  • @Luka-he5mr
    @Luka-he5mr4 жыл бұрын

    Even tough I’m already a Professional scripter I still like watching your videos

  • @barrymason5942
    @barrymason59424 жыл бұрын

    on the weekend i watched the entire beginner series and thought i had taken it all in, i came home and thought oh um well time to change my plans for that game

  • @t1logan488
    @t1logan4884 жыл бұрын

    Great video learned so much

  • @theslumpdemon329
    @theslumpdemon3293 жыл бұрын

    welp guys to learn scripting take ur time bcuz iv been scripting for over 3 years but i always did the same thing(making a game then stopping it) then i stopped scripting bcuz i lost motivation,now im starting all over again and im taking my time to learn everything

  • @haxis3764
    @haxis37644 жыл бұрын

    awesome, now I can understand the piggy tutorial series better :D

  • @AlvinBlox

    @AlvinBlox

    4 жыл бұрын

    Glad you think so!

  • @tangosf98

    @tangosf98

    4 жыл бұрын

    hey, what the? i saw you in a reply

  • @johnnunez7389
    @johnnunez73893 жыл бұрын

    Suggested videos for the future: Tutorial on pathfinding? And also making NPCs communicate and talk? Would be nice to break these down and get these explained in your style!

  • @mik4062
    @mik40624 жыл бұрын

    omg yes alvin!!! Thank you

  • @JaguarProJoe
    @JaguarProJoe3 жыл бұрын

    Wow Dry, will be so us full as I just repeated script like 5 times today, I did get something right about the script though, that they are like a setting thing, they hold values like a games setting page

  • @BlueDoggy
    @BlueDoggy4 жыл бұрын

    YAY YOU FINALLY MADE THE ADVANCED SCRIPTING TUTORIALS!!!! AHHAHHAHH MY BRAIN AHH ARH THANK GOODNESS AHHAHHAHAHHAHAA

  • @Darkerio
    @Darkerio4 жыл бұрын

    You help me so much in scripting :D tanks u

  • @justaperson7227
    @justaperson72273 жыл бұрын

    wow this is very useful for scripting I will learn more on how to use them until I completely have mastered it 👍 👍

  • @vexitory7948
    @vexitory79484 жыл бұрын

    love the channel!

  • @DanielDroegeShow
    @DanielDroegeShow4 жыл бұрын

    Please consider a tutorial on Premium player benefits and how to code them into your game. You are all about helping devs make money and this is going to be the new big thing in the future imo.

  • @gennaronapolitano6518
    @gennaronapolitano65184 жыл бұрын

    Yo need soo many more subscribers dude!

  • @nitro6803
    @nitro68032 жыл бұрын

    This is so much better than my teacher at school could ever do lol thanks so much

  • @kimathidev4937
    @kimathidev49373 жыл бұрын

    i cant believe ive graduated from beginner scripting!

  • @wavetsuname
    @wavetsuname3 жыл бұрын

    THANK YOU SO MUCH!

  • @xalim9485
    @xalim94854 жыл бұрын

    Wow I havent been on your channel for like a year or two but holy crap your voice got deep

  • @YouKnowWhosBack
    @YouKnowWhosBack4 жыл бұрын

    Yesyesyes advanced scripting!!

  • @OMGNIKIO
    @OMGNIKIO3 жыл бұрын

    Thanks i fixed my lighting

  • @boloboluu
    @boloboluu4 жыл бұрын

    Yes!! It's finally out!

  • @AlvinBlox

    @AlvinBlox

    4 жыл бұрын

    Yup :D

  • @pavlova3310
    @pavlova33102 жыл бұрын

    The beauty of simplicity.

Келесі