Hello, i need to add data about one blacklisted player into my place’s players bans datastore
how i can do that via studio command bar?
thank you.
Since you don’t need to do any kind of manipulation with any old ban data they may have, you can just use SetAsync
.
You also need to know how you prefix your keys, some people will just use the player’s UserId, or some might add prefixes like “ban_” or whatever. It’s important you get this right.
After that, just add the format you ban them in, like say you had a table of data you can just use that. If it internally errors, just try again - it’s the command bar so it doesn’t really need a pcall
.
game:GetService("DataStoreService"):GetDataStore("YourBanDataStoreName"):SetAsync(playerUserId, {Banned = true, Duration = duration})
If you have no custom ban logic and the purpose of this data store is solely for stopping players joining the game, I’d recommend looking into the new Ban API.