#Help me ai sold fr

1 messages · Page 1 of 1 (latest)

radiant ice
#

Whats a module script and why they so important?

dreamy nebula
#

Module scripts are a way to use important functions in any script without copying the code.

Let’s say you have a function called SpawnHitbox(). If you have many scripts the need that function, you can move it into a module script so all of them can use it without copying code.

nova flint
# radiant ice Whats a module script and why they so important?

💡 Want more game dev content + early access to videos?
👉 https://gnomecode.com/academy

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.

S O C I A L S
đŸ§™â€â™‚ïž WEBSITE https://gnomecode.com
🔔 DISCORD https://discord.gg/utqq7zM
🐩...

▶ Play video
nova flint
radiant ice
#

ohhhhhhhh so its global bassically?

#

but for that game

dreamy nebula
nova flint
#

You can think of a module script as a container where you can put things such as functions or variables, and other scripts are able to access that box and what’s inside it

radiant ice
#

so ye

#

so much easier

nova flint
#

Also be careful of server and client access

dreamy nebula
cedar gorge
#

not really

nova flint
nova flint
cedar gorge
#

you can just store variables too, think of pet sim, they use one module script for each pet information that they need

#

and there's no function there

cedar gorge
#

that's not really a good definition of what a module is, it can be whatever you want, a variable, a table, a function, but not specifically need to store important functions

nova flint
#

Yeah ofcourse but their primarily used for functions, that doesn’t mean they don’t have other uses

#

OOP is also a good use of module scripts but it’s less used than just functions

cedar gorge
#

why primarily used for functions?

dreamy nebula
nova flint
#

Readable and efficient code

cedar gorge
#

but it's not only that what module scripts are

#

or am I incorrect?

dreamy nebula
#

-# This poor guys form

nova flint
cedar gorge
#

its mainly used for functions really depends on what you need to do

dreamy nebula
cedar gorge
#

?

dreamy nebula
nova flint
nova flint
#

As I mentioned earlier, that in no way means it’s the only use, but it’s the most common one.

nova flint
cedar gorge
#

you're just saying again and again that it's primarily for functions and that is not real

#

they're just made for anything you want to re use

#

but not primarily funcs

#

just anything

nova flint
cedar gorge
#

no? đŸ€”

#

it can be whatever you want

#

why there's a primarily? is just for re using anything you want

nova flint
#

Whatever, you clearly don’t understand the meaning of the words ”primarily”, ”common” and ”statistics”


cedar gorge
#

but like that is not really my point, in the dude message it was only talking that it is for using important functions in any script without copying the code

#

which is in fact only a use of infinite use cases of modules?

nova flint
#

It’s a good enough example to set the expectation of what your most common use of module scripts in the future will be. It’s not the only use and neither of us said it was.

cedar gorge
#

but you're talking with somebody that does not know nothing about module scripts

#

and you're going to make him think that can only have functions

nova flint
#

What? 😭

dreamy nebula
cedar gorge
untold bough
graceful obsidianBOT
#

studio** You are now Level 10! **studio

nova flint
untold bough
dreamy nebula
#

What

untold bough
#

just like how you can return with a function, you can return with a module script

#

Reusability too