how to properly use a module script
xxxxxxxxxx
unlike script and local script module script is just a table who you
return while calling require method let me explain..
local module = {}
local rp = game.ReplicatedStorage
module.one = 1
function module:one() end
return module
anything that has been assigned to module table will be returned.
module script can shift between local and server side but changes from
local or server side will not be replicated to the other side
why module scripts?
imagine you are making a obby and you keep cloning the damage script to parts
and then 1 error comes then you have to remake all those clones and remove
them 1 by one instead you can just
require(module):Damage(touchpart)
and any chages done in the module will change it across all the other scripts
pretty much module is a table
local module = {} == require(module)
module scripts do not run alone there must be a push script to require it
then it will run and thats why it returns a table.
for best cases don't try to make connection inside module scripts because
they are not to make connections and long term loops but only to orgenize
scripts and reuse codes.