Save table to DataStore

you should read up on the roblox data store documentation https://developer.roblox.com/en-us/articles/Data-store

1 Like

If you just scroll through the post in his link you will see he’s using third party software to handle a server with the data…

What? Do you mean the link in the reply? Then, no, It’s the official Roblox article for the DataStoreService.

1 Like

uhh can you send me the time stamp to where he does that cause I dont see it

Its in post#9 by @Jackscarlett

The link I sent you was a video not his post.

1 Like

Its not, its made by someone called @F_xnn.

I was talking about his post, sorry I didn’t know you were talking about the vid you sent me. because I replied to @Jackscarlett, saying that it contains third party software, and you said it didn’t.

I’m on mobile but if you have a DataStore “BannedPlayersStore” then you can :SetAsync(“bannedplayer-”…userId, true) and when you getasync(“bannedplayer-”) it should be true which means they’re banned.

1 Like

Could you explain perhaps a bit more, I’m still a bit confused. :sweat_smile:

this is also a reasonable way to do it too

1 Like

How would I connect a table of User Id’s to this data store?

So a datastore is already a dictionary (table with string indices) as it is.

local dataStore = game:GetService("DataStoreService"):GetDataStore("BanndedPlayersList")

Now we can just set the keys of the dictionary to UserIds of banned players.

-- we make the userId into string to avoid a table and create dictionary instead
dataStore:SetAsync(tostring(player.UserId), true)

Now whenever you want to check if a certain player is banned

if dataStore:GetAsync(tostring(player.UserId)) then
   print "Player is banned"
else
   print "Player is not banned"
end