What are Module Scripts? Roblox Scripting Explained
HTML-код
- Опубликовано: 10 сен 2024
- 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
As a dev who has tried to explain module scripts to people, You did an amazing job explaining it clearly and very understandably!
That's great to hear, cheers
To you but not the average person trying to learn. I learned absolutely nothing from this. :/
@@user-N04H stop hating start learning 😂
@@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.
@@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!
I‘ve been scripting for almost 2 years now and never bothered to learn about module scripts x) very helpful video, thanks lot
I've been scripting for almost 2 year and I still don't understand what is it.
@@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)
@@saviornogame I understand now, but thank you anyways :D
same
SAME
great sense of humour, well-paced and thoughtful, immensely helpful. thanks for your hard work, gnomecode!
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!
same here, man, only difference is i dont make as many anime content as you
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 :)
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)
Dam That's crazy!
thats because you didnt set a color in
it worked for me
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)
@@reminderIknows try it out, i know im correct about this
Excellent introduction; concise and straightforward without sacrificing detail. Thanks!
I’ve been needing this for a long time. Thanks so much gnome!
Great to hear!
It seems as though you've taken a break from RUclips 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..
Yeah he is really good at explaining.Here is a brief explanation.
1. Server Script Service is where you will want to put all your normal scripts.
2.Server storage is where you store stuff like objects that are not in the workspace so the player won't see them good for rotating maps. Sometimes values are stored their such as your stage in an obby it's basically where you store server stuff.
These could defo be useful to beginners. Great job man!
Glad you think so!
Very Usefull for bigger projects! Thanks for making this video
Thanks for the good vibes!
Trying to just new learn skills that I might need in development, this one sure will help. Perfect teaching, thanks
thanks man, best explanation i’ve seen
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
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
yeah
This is so handy, thank you so much. The video was short, and you explained it so well.
I though it was boomsasok for 30 secs
@@ItsPedro9898 j t o h
who dosent love this dude explaining stuff clearly
i am currently spending an hour and a half messing with random things, trying to get it to not say "requested module experienced an error while loading" every time i press play. EDIT: ok i finally fixed it, but i have a question, how would i go about putting the object i spawned from the module script list into a player's backpack?
Thank you so much, this tutorial is really easy to understand and you explained it so well! Keep going!
Best tutorial on Roblox Studio I have ever seen, thanks!
YO BRO TYSM! I FINNALY UNDERSTOOD WHAT MODULE SCRIPT NEED! TY
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.
So... it's kinda like the reason why you want a separate file for all of your CSS in html
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)
Thank you so much man! This will really help me organize scripts!
This is one of the few tutorials i have actually learnt from, thank you so much!
Perfect introduction to module scripts. Many thanks
Short Explanation:
Module script needs a Script object that has require(Insert Module Script Location) in it
my brain focused so much in this and i learned a LOT
Hey! GnomeCode why i can edit teddy game?
This is such an amazing tutorial, it's actually very good
People all need explain like this. Thanks for this video
I subcribed
Glad it helped, thanks for the sub!
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.😥😥😥
Even though i dont really use these, im happy that know i understand them better, thank you
wow this is great, helped me alot managed to impethis into my game
for the example shown at 3:20 or so, you can just do:
return {
["Apple"] = {
Price = 50,
}
}
Thanks!I abondoned a HUGE amount of projects since the code was messy...! If I only knew...
Try making smaller projects or work on a friend’s project for a while to learn organizing code better
@@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.
Fun fact: module scripts are very useful when making programming languages
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.
This is a great tutorial. It really helped me a lot. Thanks 👍
u explained this in the best way possible
Can I use module scripts to make like a chance percentage on egg hatching system?
Fun stuff, knew what modules do but never knew you can use functions
w apple teaching, keep it up
Your the best garden gnome
bro this is so useful !
thanks i never knew what module scripts are now inknoe
i love how he says "lilcal script" for local script lol
Hey thanks! I'm not really a good scripter but I wanted to know what this does so I'll know in the future!
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.
Wow I code on roblox, this will help me make my scripts not so long! Thx so much! 😍
Workspace.Script:3: attempt to index nil with 'Oranges'
Wrong quote, you have to use double quotes for string….
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
G’Nome!
Thank you man! H, Verry cool.
can someone help me make a script that makes a *model* dissapear, then right after they dissapear another *model* appears (then the cycle goes on forever)?
please give me scripts for both *models*
Why can’t I just write everything directly into one main script instead of using a normal and a module script?
i think its to organize since organizing is useful for it to be easy to add new code in the script without destroying the entire game like moving a single domino in a stack of dominoes
Thanks now I understand module scripts very well :)
That's great to hear!
Can someone explain why i got a module congfig manager Warning??
Your next video should be about anti-exploit scripts.
Gnome code doesn’t need the toolbox, the toolbox needs him.
How do I turn someone into another character using a model script?
and could you do a video of effect like beam explosion effect smoke it could be useful for me or the comunity thanks
so it's basically a public table for scripts to access?
Most of my coding knowledge is in c#, are these like classes?
as a developer and a exploiter this information is useful for backdoors
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!
so basically modulescripts are functions except in physical forms ?
how could i add more/modify variables in a module script using other scripts?
This video helped me a lot!
Yes please do on OOP. I would love to watch it.
wow its could be super usefull ,remind me of Json or Objects in JS
It's make changes in the Sarver or claint?
Module Scripts: Commonly used in virus-related scripting because of their ability to be required from the Library.
pensi
@@krianee6662 that word translates to think
1:24 my favorite fruit is a tomato
the fruit dictionary made me forget basic scripting
ohh hell no, I know he did not just say "and everybodysss favorite FRUIT, A tomato!!!", My mind just committed suicide.
please help me the code from ur doors tutorial is completly broken with me it only loads in 3 doors for some reason please help ive been waiting entire day
Hi, sorry to hear you've been having problems. Do you have your output window open? That should help you by telling you where any specific errors are coming from. If you still need help, I'd recommend making a post in my Discord's help channel as it's much easier to help people there.
as a person who likes giant scripts, i can confirm i will rarely-never use these.
Thank you for the tutorial👍
So helpful!
Already know but it was still cool to get a recap
Wish when I was learning scripting this video existed
Are you going to do videos on how you changed the teddy ai or building chapter 4???
Can you edit a player gui inside of a module script?
I don't remember bricks being a fruit.
Thank you
amazing man!
That was so USEFUL!!! Thank you for helping me so much!!!
Is the Module similar to a Class in OOP ? i got it. Nice and very clearly explanation 🙌
nice outro!
Cheers
Thanks
Amazing Tutorial!!!
I never knew how to use a modulescript until now...
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"
So... they are classes/structs like in the rest of programming languages.
Yup!
1:32 tomato is not fruit
Thank you, I really understand now🎉
im trying to make a require script but it does not work
so i watch this
So, it’s like a library?