The question I have is rather simple, should module scripts ( or in this case, a module script nested inside a module script ) be setting data itself or simply returning data? The difference is minor in my opinion but I wanna know if one is discouraged or if it doesn’t really matter.
The benefit of the module simply setting data means I don’t need to include any code in my main script to handle any returned data which I imagine is the main functionality of a module script. The alternative however would allow me to customize each use-case and process each returned value differently.
Opinions?
( by setting data I mean modifying a table that holds the player data, for example " gold " and not trying to save using a datastore )
Doesn’t really matter lol, strictly there’s no “right” way to do this, most people just use scripts to load the modules and let the modules handle all the logic but it doesn’t even matter if u do some logic inside the scripts either
A common solution is to have two module scripts, one thats just the raw data, and one thats a set of functions that will handle and format the data appropariately for a few different cases. Its the best of both worlds.
I’l try to implement this, the concerns I had were to do possibly with any limitations or poor coding practices, but I am happy it doesn’t really matter.