Hi everyone, I'm currently working on a perm ban system using DataStores. For this to work efficiently, it needs tables. I don't know what is the correct format to create tables in DataStores. Do I just make up the table name and it will appear?
Here is some example code
store:GetAsync(key, table.insert([TABLE NAME HERE], id)

6 comments
How would I add values to the table then?
put the values in {}
Yes, but it gets added in-game, meaning it would have to be table.insert() or something.
then use getasync(),insert it, and save it back the the datastore
store:SetAsync("BanTable", add) add is the table.insert(), it comes out with argument 2 missing.
In this situation, you'd want to use :UpdateAsync() as there is potential for it to be changed by multiple servers. With it, check if an old value is there, and call
table.insert(THE_TABLE, NEW_BANNED_PLAYER)on it.