Save table to DataStore

no it uses no third party module, your the one making the module and handling the actual data saving. It may seem like that since he is creating the data handler as a module script and in another script he is calling functions from that module on whether to save or add data

1 Like

How would I get a ban table from a data store? and how would I save this ban table within this data store?

Does the table already have information in it?
If you want to save a table to a datastore, you can do it by something like this:

local Table = {}
YourDataStoreName:SetAsync(Key, Table)

uhh you would saving it using the same key over and over, so when your saving you could use a key like “ban_data_key”.

1 Like

He’s using a website for the data store, I don’t want that, I want to save my table to a Roblox data store with DataStoreService.

no he is not. I do not see how he could be using a website to save his data. He is using roblox data store service

1 Like

If you want to save a table, you can make and use your own unique key.
Data Stores (roblox.com)
How to do a ban system with DataStore - Help and Feedback / Scripting Support - DevForum | Roblox

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