Is it possible to use tables for serverban scripts

Okay, so basically im tryna make a serverban script for vip servers and moderators, but I’m wondering if its possible to use tables for server bans. I honestly never tested it, so I really wanna know if it’s possible or not, and if it’s reliable or not.

If it’s reliable, why? If not, why?

Its possible also save the table on data store service you could also access the table if ever you want to check who are the banned players, you can also remove them:

Edit: Now that I think about it you can just store it on the player:

defaultData = {
	{...} -- other things like money, inventory, etc.
	BanData = {
		IsBan = false,
		UntilBanned = 0

Do you mean a server-based ban or a global one for the game (all servers)?

This is how server-bans work. The player list doesn’t save, it’s only a list stored in the server.

I suggest you make the table global so you can access it from several scripts. E.g.:

_G.ServerBanList = {}
game:GetService("ReplicatedStorage").AddBanEvent:Connect(function(player, targetID)
         if player.UserId == 000000 then
                table.insert(_G.ServerBanList, tonumber(targetID))
                print("Player is not a moderator")

And you can check the list with a loop:

         for index, value in pairs(_G.ServerBanList) do
               if player.UserId == value then
                       player:Kick("Server banned.")

Once the server shuts down, the list will be obviously lost.