#How do you use module scripts?

1 messages · Page 1 of 1 (latest)

swift granite
#

Please teach me!

wintry mauve
steep patio
#

u can use them for a lot of stuff. U can reuse functions in different scripts refering to the same module script

mystic hill
#

Its easier to think of them as like dictionaries you can access from different scripts. Modules stay idle until another script asks for them, vs having a ton of things mashed into scripts that die or sit in bubbles

slate pier
#

A module script could also be seen as a globally acessible table. You can make a list of stats or values that every player can acess, or you can put functions in it that every script can use for itself

frank sonnet
#

module scripts are basically just functions.

#

cool thing about functions is returns

#

and cool thing about lua tables are metatables

#

you can make classes and class objects with them

#

you can use them to hold data

#

or use them to make libraries