Mewious
(Mewious)
July 24, 2020, 1:17am
#1
WARNING DO NOT USE THIS MODULE ITS OUTDATED USE PROFILE SERVICE INSTEAD
MewsData (MDS) is an open source datastore module that can be used to store data efficiently. This is used for simple, saving, values and tables right now also this is my first open source project, so feedback/criticism would be appreciated.
– this is for simple saving and meant for beginners
you can get it here - https://www.roblox.com/library/5416607607/MewsDataV1
you can view it here - MewsData - Pastebin.com
STEP 1: REQUIRING A MODULE
local MDS = require(ModuleHere)
STEP 2: LOADING A VALUE
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Parent = leaderstats
leaderstats.Parent = plr
MDS.Load_Value(plr,cash)
end)
STEP 3: LOADING A TABLE
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
local cash = Instance.new("IntValue")
cash.Name = "Cash"
local gems = Instance.new("IntValue")
gems.Name = "Gems"
gems.Parent = leaderstats
cash.Parent = leaderstats
leaderstats.Parent = plr
MDS.Load_Table_Data(plr,leaderstats:GetChildren())
end)
STEP 4: SAVING A VALUE
game.Players.PlayerRemoving:Connect(function(plr)
MDS.Save_Value_Data(plr,plr.leaderstats.Cash)
end)
STEP 4: SAVING A TABLE
game.Players.PlayerRemoving:Connect(function(plr)
MDS.Save_Table_Data(plr,plr.leaderstats:GetChildren())
end)
Again, criticism is well appreciated. I hope you consider using this module for your projects in the future!
18 Likes
Can this save across different games?
2 Likes
Mewious
(Mewious)
July 24, 2020, 1:21am
#3
the data can be saved across different places in your game
1 Like
Cool module, however I’d personally more prefer the methods to be named in PascalCase rather than Snake_Case.
Would it be possible for you to include a way to show the source of the module for those who can’t view it?
4 Likes
posatta
(pasta)
July 24, 2020, 1:35am
#6
For the record, that’s not what snake_case is; the module is using Darwin_Case. I’d prefer either snake_case or PascalCase, but it’s really not a big deal.
6 Likes
Mewious
(Mewious)
July 24, 2020, 1:35am
#7
the source code is included in the model
1 Like
KdudeDev
(Kdude)
July 24, 2020, 1:54am
#8
Is there anything that makes this different/better than Datastore2?
2 Likes
That’s not the point,
Additionally, makes the module more trustworthy before inserting.
2 Likes
Mewious
(Mewious)
July 24, 2020, 2:00am
#10
ohh okay i get you now thanks for the feedback i will add a pastebin
2 Likes
Mewious
(Mewious)
July 24, 2020, 2:03am
#11
imo its easier for beginners to understand does mostly the same thing
1 Like
sjr04
(uep)
July 24, 2020, 2:20am
#12
No need to reinvent the wheel — assert
exists.
assert(typeof(Player) == "Instance", string.format("bad argument #1 to LoadData (Instance<Player> expected, got %s)", typeof(Player)))
assert(typeof(ObjectsToLoad) == "table", string.format("bad argument #2 to LoadData (table expected, got %s)", typeof(ObjectsToLoad)))
8 Likes
I completely agree, I don’t see how this will be used more than datastore2, it’s programmed a bit inefficiently.
For example:
Datastore2 has bindtoclose and autosaving functions, which makes it significantly better than this module
Nice job, I will be looking to use this maybe.
1 Like
sjr04
(uep)
July 24, 2020, 2:27am
#14
This module forces me to give it some sort of ValueBase instance (e.g. a StringValue) so I can save its Value
.
What if I wanted to not do this? I am forced to create a new StringValue just for the sake of saving a string.
We should not be forced to use ValueBases just for the sake of saving data.
Also
Why does it use :UpdateAsync
if you aren’t actually using the data
parameter?
3 Likes
In what way does this differ from ROBLOX’s default datastores or an already existent module similar to what this does called DataStore2? (How to use DataStore2 - Data Store caching and data loss prevention )
1 Like
He has already responded that here
1 Like
sjr04
(uep)
July 24, 2020, 2:29am
#19
It doesn’t do the same thing, this module is really lack-luster.
Oh okay. Thanks for the quick response.
Well a suggestion I have to your code is instead of making two separate methods for table data and normal data, combine it into one and simply check which type it is. OR perhaps create a class called datastore_value and allow users to put the data they want to store in there and use it for a saving method.
2 Likes