So basically i want to know if a datastore with a different key can override a players data so for a Example
Parts Data
DataStore:SetAsync("Parts", some table)
Players data
DataStore:SetAsync("Key_"..plr.UserId, Some table)
So basically i want to know if a datastore with a different key can override a players data so for a Example
Parts Data
DataStore:SetAsync("Parts", some table)
Players data
DataStore:SetAsync("Key_"..plr.UserId, Some table)
DataStores have infinite “columns”, to simply put it. As long as the key is different, it won’t affect anything. But as soon as you use the same key for a player instead of the parts, it will think you want that “column” and override that. Otherwise, you’re good to go!
If I’m not mistaken, I think you’re saying if one key can overwrite another key?
If that’s the case, no it shouldn’t. Because you’re making two entirely separate keys and plus, the amount of DataStore’s doesn’t matter. What I believe can happen, though, is if the key has too much data to save (like too much within one table) and can possibly drop some data.
What would override another is if they both have the same key.
Maybe you should’ve browsed in the Data Stores article talking more about DataStores’ work.
Thanks i wasn’t sure about that and i do not want to make my players lose data which is the worst thing that can happen in a game atleast for me.
Just make sure to use the BindToClose function! (This will certainly prevent data loss, if your servers shutdown for an update, etc…)