That module is long gone since 10 months, and the topic has been locked as well, there is absolutely no reason for you to use that module.
Using this or profile service should be decided by your self, based on your needs. ProfileService offers a powerful API and has session locking with one of it’s primary features, whereas DataStore2 offers a somewhat bloated API (but a lot comprehensible) and has backups as it’s main feature. With that being said, I highly recommend using ProfileService.
Wait, why should we use your changes rather than the vanilla Datastore2? You never clarified on why I should use yours, and is it backwards compatible with vanilla Datastore2?
Is it possible to create a data store with this module that does not belong to one specific player? As in, a way to make a data store that all the players can access? Should I just use a regular datastore for this?
Another question adding on to this:
If I need to use a regular datastore, does this module work interchangeably so I can use DataStore2 for some data and the regular Roblox datastore for others?
Hey there! A few questions I would like to ask. I am fairly new with this module and from what I have picked up so far is basically that data gets saved or put on an in game cache which are the keys. The combine basically then takes all the in game cached data and puts into a big table which then gets saved? My first question is, why would you then save a table in the first place if combine does that for you. That just creates more pain as then you have to get the table, and insert your new values compared to just being able to directly update 1 value which later gets put into a table.
Will you implement a function for session locking like profileservice?
Is it ok to save lots of data under keys and not use tables at all?
Would datastore2 be a good module to create a player guild system with?
And finally, using both datastore2 and profileservice wouldn’t work right?
If you answer these questions that would be great man! I am developing an rpg game with lots of systems e.g inventory, character customization, guilds ect. Have a great day and if you reply thx so much!!
Well, I am new to datastores and I have been slaving over for days now trying to save tables and update values in it. Also, I have been scripting on and off for 2 years now and I gotta say the biggest hurdle is not learning how to script, its learning how to script efficiently and have optimized code. I never really took that into consideration so now its like I am screwed. Anyways, thx man for answering
How heavy is store:Set(value) on performance? I have a custom inventory system, and there are cases where there might be done store:Set() every second for each player, to update their inventory. Here is the relevant chunk of code
if hit.Name == "GoldMine" and state.Value == "Attacking" then
inventTable["Golddust"] += 1
inventStore:Set(inventTable)
end
Will this affect performance too much? And if so, how can i improve this?
Suggesting the value is not a table. The code in question:
local defaultKillCount = {
Rat = 0,
Crow = 0,
Slime = 0
}
local killsStore = DataStore2("Kills", player)
dataKillCount[player] = killsStore:GetTable(defaultKillCount)
That’s it. I ran it once for one player and it worked first time only. I did not update the table from the default values (just checking the code), and now it is completely broken. Is there a workaround to salvage this datastore?
EDIT: must have been a save error in the initial setup. I saved the default table over it manually and now everything works again. I’ll get my save functions up and running!
EDIT2: nope, still broken!
EDIT3: OK, it appears during one of my early tests, I accidentally crossed datastores, filling Kills with “Experience” from Stats. I can no longer overwrite the contents of this datastore. It acts like it overwrites, but then it goes back to this value. The error is because a string is not a table (predictably). Unsure how to clear this datastore out and try again.
I’m making a ban system with this datastore and was wondering, is it possible to edit a player’s data that is NOT in the game. I need a way to unban a player (reset ban value to original, which is unbanned) and I don’t know how to do this without them being in the game.
The normal way of doing data stores is to keep a cache somewhere of a player’s data (such as in a folder or using leaderstats), then saving when the player leaves. It is wrong, however, to use DataStore2 this way. DataStore2 is built to be used whenever your data actually changes. You shouldn’t invoke DataStore2 in PlayerRemoving at all. Don’t worry, :Set will never error or do API calls, it’s all cached. DataStore2 will save the player’s data before they leave.