I was reading some data storage tutorials and I came across this: Documentation - Roblox Creator Hub
in this tutorial the datastore is in a moduleScript, in ServerStorage, and this moduleScript has a “PlayerStatManager:ChangeStat()” function and I got a question, instead, why not put this script in a normal script, and use bindableEvents instead PlayerStatManager:ChangeStat()?
sorry if i wrote something weird, i’m using google translator.
The difference with saving a script with a module, or just a regular script is that you can require them to get players data from other scripts, or save data from other scripts.
Example:
mod = require(script.DataModule)
data = mod:GetData(Player.UserId) -- returning data from player
mod:SaveData(Player.UserId) -- saving the players data
There are other ways to get data the same way with using a script like Bindables for example. However people prefer using Modules over Bindables when it comes to data, mainly because it keeps your code nice and clean. Also I’m not sure if this is true or not, but Bindables would likely use up more performance/memory than a regular module would.