Alright so I’m making a ban system and using datastores, I was going to put all the values under 1 key in the datastore (Like a large list - because this is what I’ve heard to do)
Anyways the main problem is lets say I ban the userid 1. It works and everything, but then when I ban lets say the userid 2 everything else in that list would be wiped (Like userid 1)
So basically I can only have 1 user banned at once
I’ve tried a different method of every person banned has their own key, but then I can’t grab all the keys to make like a banned list that you can view (or at least I’m not sure how)
Yeah I’m not much of an experienced scripter, but here’s the piece that saves it
local Data = {
[TargetPlayer..':Banned'] = true,
[TargetPlayer..':Reason'] = NewValue,
[TargetPlayer..':Length'] = NewBanLength,
[TargetPlayer..':Admin'] = Player.Name
}
local success, err = pcall(function()
BanDataStore:SetAsync('List', Data)
end)
The TargetPlayer is the players UserId
I also got the datastore editor plugin that’s how I’ve been testing it
Edit: Wait it saves to the List I forgot to change it back because I was trying something else out
I was going to do that I just wanted to try and make like a list you can view in game (Some other people were also saying to do that)
I guess I’ll just do that tho