Just a simple question, how could I create a key with Data Stores to a new player in-game?
You cannot assigns data store keys to certain players like you can with data persistence, but you can do something like assign a key that has their username/userid.
For example:
ds=Game:GetService("DataStoreService"):GetDataStore("Users") Game.Players.PlayerAdded:connect(function() ds:SetAsync(tostring(player.userId),player.Name) --That would create a key with a name that is equal to their userId and make the key's value their username. end)
You can edit it so it matches what you want it to do.
DataStore = game:GetService("DataStoreService"):GetGlobalDataStore(); game.Players.PlayerAdded:connect(function(player) local keyName = player.userId .. "_keyname"; -- you should use their userid, incase they change their username local newValue = "new value"; --change this to the key's value DataStore:UpdateAsync(keyName,(function(oldValue) return newValue end)); end)