Unable to Cast Array

I was trying to make a ban system, but I’m not good with datastores so I used a free model and edited it to fit my needs. So I work for a small game studio and was trying to make a ban system, but instead of making a new one I decided to use the ban system I was talking about above from one of my older games. I wanted to add a way for moderators to add reasons to the bans, so I tried just adding “reason”. I got this error: image

My code looks like this:


(I’m very aware at how scuffed this code is, please don’t mention it)

Can anybody help me with this?

The problem seems to be :SetAsync, as you’re passing a third argument. Just store the ban info in a table and save it. AND also, I recommend using the key argument as the target id.

local data = {
    IsBanned = true,
    Reason = "REASON_HERE"
}

banlist:SetAsync(target.UserId, data)