Hey Everyone, I am making a Ban System It somewhat works, When I type the username of a Person, it bans them, and it works fine with data store too. But i am trying to also do the feature, "The Reason of the Ban"
local banTable = {}
table.insert(banTable, player.UserId, script.Parent.PanelScript.Panel.Frame.banReason.Text)
banDatas:SetAsync(player.UserId, banTable)
When I Try to save the data like This, On the DataStore, it's saved as value "dict" and "" (Basically nothing inside)
https://i.imgur.com/EoADJgQ.png
When the player is banned, I want to tell the Banned User, Why He/She was banned for.

5 comments
I see what you mean, but the UserId, works fine, I am just having the trouble saving the reason why the User was banned
Because table.insert() is assuming you want to place the ban reason at the index value of the user ID. Obviously that index number is out of bounds, so it doesn't work. You're better off creating a key.
I did another table.Insert() for the reason now, I have 2 Values on the table, but still the value isn't what I typed as the Reason of the Ban, it's just "" (empty) Do you think you could add me on discord, so you could help me out please? afterlife#7521
Hey, I edited the Value for the "Reason" on the DataStore Editor Plugin, and it worked fine, basically I am just saving it wrong somehow, i did 2 table.Insert() i save the Text of the TextBox, but it saved as nothing, I don't get it why!
Ok, just use the key format of banTable[player] = banReason. At this point you're overworking yourself.