How to make a Ban cmd

So I own a sword fight game and I ain’t a scripter I’m just the owner how could I add a ban script here my kick script if you need a example of it:

			if player.Rank:FindFirstChild'Admin' or player.Rank:FindFirstChild'Mod' then
				for index, plr in pairs(game.Players:GetChildren()) do
					if string.match(string.lower(plr.Name), string.lower(args[2])) then
						plr:Kick(tostring(args[3]))
					end
				end
			end```

Thanks!
1 Like

You could just create a DataStore & table of players which would hold all of the bans for specific players that you want to kick/ban, the insert the Player’s UserId into the table & save it using SetAsync()

local DataService = game:GetService("DataStoreService")
local ModLogs = DataService:GetDataStore("Kick/Ban List")

local BannedPlayers = {}