Problem with Adminsystem

Okay so. Ive been trying to make a custom adminsystem for myself. I havent done something like that yet and also havent really worked with datastore. So i did it after a tutorial on Youtube.

Well, now to the problem. Somehow :FindFirstChild always gives back a nil, no matter what i type in the chat, even if its a player thats also ingame, can anyone help?

Code
local DataStoreService = game:GetService("DataStoreService")
local banDataStore = DataStoreService:GetDataStore("banDataStore")
local commands = {}
local prefix = ";"
local admins = {
	"Flauschi_XD";
	"Player1";
}

local function findplayer(name)
	for i, player in pairs(game.Players:GetPlayers())do
		if string.lower(player.Name) == name then
			return player 
		end
	end
	 return nil
end

local function isAdmin(player)
	for _, v in pairs(admins) do
		if v == player.Name then
			return true
		end
	end
	return false
end

commands.ban = function(player, arguments)
	local playertoban = arguments[1]
	local playertobebanned = game.Players:FindFirstChild(playertoban)
	if playertobebanned == nil then
		print("error")
	else
			local playerid = playertobebanned.UserId
		local success, errormessage = pcall(function()
			banDataStore.SetAsync(playerid, true)
		end)
		if success then
			print(playertobebanned.." is now banned!")
		end
	end
end


game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message, receipient)
		if isAdmin(player)then
		message = string.lower(message)
			local splitstring = message:split(" ")
			local commandtriger = splitstring[1]
			local cmd = commandtriger:split(prefix)
			local cmdname = cmd[2]
			if commands[cmdname] then
				local arguments = {}
				for i = 2, #splitstring, 1 do
						table.insert(arguments,splitstring[i])
				end
				commands[cmdname](player,arguments)	
			end	
		end
	end)
end)

AFAIK, you’re not using the findplayer function in the code you provided?

i do actually, since there also is a teleport command in there, but i didnt put it into this post since that works perefctly fine

Can you print all of the arguments that the ban command receives when it’s executed? Immediately after the command is ran, preferably.

The ban command only receives one argument and thats the players name which the command is ran on (;ban Flauschi_XD)

What I was getting at, is arguments[1] the name you provided, or “;ban”?

The name (thirty chars)…

Fixed the system now myslef by modifying the code a lot