#modul script
1 messages · Page 1 of 1 (latest)
no need to learn about metatables rn
just put on a tutorial about module scripts
oh alright
but what is a metatable
I don't think you need that rn just learn about modules rn
module scripts are not global functions tho
** You are now Level 12! **
no they arent
yeah
first understand what is a module script
than worry about metatable
its OOP
thats like the only use i know about them
i do
what is a module script
a script that can contain multiple different things it can do that can be called by any script, local or server, and the called function will be ran on the context of the script called
the only USE i know of is global functions but i've heard theres more uses
im just looking to know what those are
a lot more uses
okay you do understand on a surface level
on a deeper level module script gets ran once when it's required for the first time
and then put into memory
later calls will use the one in memory without running the module again
so basically it's a table
actually no
it's a value
any value
module scripts are huge values
oh alright
what are some other things you could do then
storing values
stroing anything
like how
local module = {}
module.myValue = 10
return myValue
you don't understand modules if you don't understand what I'm talking about
ah alright
and if i were to set myValue to 20 on a script, would it return 10 or 20 on a different script?
if im not mistaken you can store literally anything. lists, variables, functions, anything you want. you just use modules when you wanna use the stored info in multiple scripts
And are modules able to be modified at any point by other scripts? Or are they read-only
Mutable
that would make sense i guess

they act just like any other value
that's it
if you have a table it's a table
if you have a number it's a number
Ahh!! Thx for the answer :D
Ill keep it mind
i have learned how a module script works