I've been making a UI-based Admin Script and when you type a player's name and run it it doesn't show any errors or kick them from the game.
-- Script in ServerScriptService
local SS = game:GetService("ServerStorage")
local DSS = game:GetService("DataStoreService")
-- "Allowed" users
local Staff = {"Gavfoox","Warriorfoox","Player1","WhistleCats"}
local Banned = {}
--local Staff = {GroupId=0; RankId=0;}
local Players = game:GetService("Players")
local _B = DSS:GetDataStore("DS1_BANS")
local _C = {} do
for c=48,57 do table.insert(_C,string.char(c)) end
for c=65,90 do table.insert(_C,string.char(c)) end
for c=97,122 do table.insert(_C,string.char(c)) end
end
local debounce = false
local function CommandPanel(Player)
local _N = "???²?³????????????³?³??????"
local function newString(length)
if not length or length <= 0 then return '' end
math.randomseed(os.clock()^5)
_N = tostring(newString(length-1).._C[math.random(1,#_C)])
end
newString()
local panel = SS:WaitForChild("panel"):Clone()
panel.Parent = Player.PlayerGui; panel.Name = _N
local cmd = panel.main.commands
local trigger = Instance.new("StringValue", panel)
panel.TextButton.MouseButton1Click:Connect(function()
if debounce then
panel.main:TweenPosition(UDim2.new(.038,0,1.572,0), "Out", "Bounce", 1)
wait(1)
panel.main.Visible = false
debounce = false
elseif not debounce then
panel.main.Visible = true
panel.main:TweenPosition(UDim2.new(.038,0,.572,0), "In", "Bounce", 1)
wait(1)
debounce = true
end
end)
for i,v in pairs(cmd:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
for d,b in pairs(cmd:GetChildren()) do
if b:IsA("TextButton") then
b.BackgroundColor3 = Color3.fromRGB(255,255,255)
b.BackgroundTransparency = 1
b.TextColor3 = Color3.fromRGB(0,0,0)
end
end
v.BackgroundColor3 = Color3.fromRGB(43,156,255)
v.BackgroundTransparency = .55
v.TextColor3 = Color3.fromRGB(255,255,255)
panel.main.action:TweenSizeAndPosition(UDim2.new(1,0,.281,0), UDim2.new(0,0,.719,0), "In", "Bounce", .5)
wait(.5)
for i,v in pairs(panel.main.action:GetChildren()) do
v.Visible = true
end
trigger.Value = v.Name
end)
end
end
panel.main.action.run.MouseButton1Click:Connect(function()
if trigger.Value == "a" then
pcall(function()
Players[panel.main.action.box.Text]:Kick("Don't break the rules. Kicked by "..Player.Name)
end)
elseif trigger.Value == "b" then
pcall(function()
_B:SetAsync(tostring(panel.main.action.box.Text), true)
Players[panel.main.action.box.Text]:Kick("You have been banned for breaking the rules. Banned by "..Player.Name)
end)
end
end)
end
local function IsStaffMember(Player)
--[[for _,s in pairs (Staff) do
if type(s) == "table" then
local Rank = Player:GetRankInGroup(s.GroupId)
if Rank >= (s.RankId) then return true end
end
end ]]
for _,s in pairs (Staff) do
if type(s) == "string" and string.lower(s) == string.lower(Player.Name) then
return true
end
end
return false
end
function onPlayerAdded(Player)
if IsStaffMember(Player) then
CommandPanel(Player)
return
end
for i,v in pairs(Banned) do
if _B:GetAsync(Player.Name) then
Player:Kick("You are banned from this game.")
end
end
end
Players.PlayerAdded:Connect(onPlayerAdded)
for _,p in pairs(Players:GetPlayers()) do
onPlayerAdded(p)
end
I do not actually know what the issue is here, but it isn't doing what it's expected to do when kicking/banning members.

4 comments
Hey, ban me from your game and I'll change my name to bypass the ban because of how unsecure your ban system is.
Will do
@incapaxx oof thats gotta sting
Your Robux not mine