Which is more efficient for data stores? Scripts or Modules

I just have a question on which would be more efficient for data stores. Which would handle it better. Or is it just the same?

1 Like

I typically use modules for handling data stores, so It can be accessed from different areas easier.

1 Like

No difference, just depends on your organisation and/or preference.
The code in a ModuleScript will run the same when you call require on it, no difference in efficiency.

Edit:

People tend to typically use these as data handlers yes, just do whatever you think looks more organised.

Just the same.

1 Like

Modules would be more organized typically correct?

Oh I see. Thanks.

Iā€™d rather use modules because modules are typically used for organization, and to simplify things. For example, instead for writing long code to do damage you can just make a function in a module called doDamage and it will do a specified amount of damage, making tens of lines of code condensed into one.

2 Likes

I see what you mean by that. It would be easier to use modules to access different areas. In my opinion.

So they work the same, just modules can be used for a little better organization

1 Like

Yeah so lets say for example in my inventory module when a player gets a new item i can require the datastore module and easily update the data that will be saved at the next interval, I usually save data at specific time intervals.

1 Like

I gotcha. Thank you guys. (30chars)