I do understand the default Datastore system but this seems very different to use.
I think he is pointing out that there is no player/playerid parameter supplied in the connect or set function which is what youâd most likely expect for a datastore interface.
I havenât read the moduleâs code, but it looks like youâre organizing data like this:
data = {
["key1"] = {
["player1name"] = val,
["player2name"] = val,
},
["key2"] = {
["player1name"] = val,
["player2name"] = val,
},
}
instead of like this:
data = {
["player1userid"] = {
["key1"] = val,
["key2"] = val,
},
["player2userid"] = {
["key1"] = val,
["key2"] = val,
},
}
This makes more sense organizationally in my opinion and would allow you to call things like
playerData = Datastore.Get(player)
or playerDataValue = Datastore.Get(player, "key")
instead of manually indexing the list using the playerâs name (which should be changed to ID by the way, in case the player changes their name).
Iâm not sure what ${rules} are you talking about
Oooh, okay! Iâm happy to see you like it!
My datastore doesnât save when I set it. Code:
(username is a string)
banDatastore.set({
[username] = _G.PlayerData[username];
})
Could you make additional functions that work like :SetAsync() and :GetAsync() so that people newer to datastores could just change the value of their datastore variable to the module?
I donât feel like this is so potential. It isnât a big thing to rewrite someoneâs saving system to this one.
In the example code, itâs not really neat to show the person you want to give these coins/data stores to using their username. If they change it all their stuff is gone.
Itâs just an example : P
You can do it with UserIDs too.
Could i make a global leaderboard with datastoreX? And what functions of datastore X would i have to use to make this possible?
can you explain one reason i should use this instead of profile service or is this just a simple data store for people to use with no benifits.
I feel like you should read the replies first:
Yeah, this is why you should also read the replies for more information.
I see your point, however, what I quoted is pretty much the most obvious thing you can expect from a DataStore wrapper. Iâm not saying that all the information should be transmitted through replies, but donât expect to find all the information in the original post.
Anyways, I wonât continue this discussion since itâs getting off-topic.
yo chill bro he just said read the replies