Admin Panel Banning and Unbanning Players

2 questions. 1st. How would I unban a player? since I don’t think doing “:Unban()” would work. 2nd. How can I make the 2 commands unban and ban from ANY server even if they offline or not.

				--Ban Player
			elseif SplitCommand[1] == ":ban" or SplitCommand[1] == ":Ban" then
				local TargetedPlayer = SplitCommand[2]
				local Name = game.Players:FindFirstChild(TargetedPlayer)
				Name:Kick("You have been banned  by a Blossom County moderator. If this was a mistake, please appeal in our Discord server linked below our game.")
				--Ban Player
				
				--Unban Player
			elseif SplitCommand[1] == ":unban" or SplitCommand[1] == ":Unban" then
				local TargetedPlayer = SplitCommand[2]
				local Name = game.Players:FindFirstChild(TargetedPlayer)
				Name:Unban()
				--Unban Player

Theres no such a function as Player:Ban() or Player:Unban()
You must use DataStoreService to store every banned player and check if the player is banned whenever someone joins the server.

Ok… I was watching this video which helping me script it. Then realized there is nothing such as :ban and :unban. I don’t know what data stores are so Ima watch some videos on data stores. Wait but is it possible to unban or ban someone even if their offline?

You must use thiser UserId in order to ban or unban them

Wait so when I type :unban in the chat I would need their userid and not their name?

The video said to make this.

				game.Players.PlayerAdded:Connect(function(Admin)
					local BanList = Instance.new("Folder")
					BanList.Name = "BanList"
					BanList.Parent = Admin
					
					local Banned = Instance.new("BoolValue")
					Banned.Name = "Banned"
					Banned.Parent = BanList
				end)

Then to add a data store to it, is that correct/

Also you should make a variable named commandSplit then do string.lower(SplitCommand[1]) this way no matter how they capitalize it, it should work.

Question, how can I make a moderator put a reason for the ban in my script? Also how can I make the moderator’s name show in the ban on who banned the player?