I'm making my own admin script and I'm not so successful.
function bancheck(plr, ban) if ban.Value == true then plr:Kick("You're banned") end end function Admincheck(plr, Admin) for i, Name in ipairs(Admin) do if Name == plr then admin = true end end end function onkill(msg, plr) if msg:sub(1, 6) == prefix.."kill " then local TargetPlayer = game.Players:FindFirstChild(msg:sub(7)) if TargetPlayer then local ctr = TargetPlayer.Character or TargetPlayer.CharacterAdded:Wait() local hum = ctr:WaitForChild("Humanoid") hum.Health = 0 elseif msg:sub(7):lower() == "me" then plr.Character.Humanoid.Health = 0 end end end function onban(msg, plr, Admin, vip) if msg:lower():sub(1, 5) == prefix.."ban " then local TargetPlayer = game.Players:FindFirstChild(msg:sub(6)) if TargetPlayer then for a, b in ipairs(Admin) do if b == TargetPlayer.Name then if plr.Name == vip then if TargetPlayer == vip then else Banned:SetAsync(TargetPlayer.UserId, true) TargetPlayer:Kick("You're banned") end end end end end end end function shutdown(msg) if msg:lower():sub(1, 10) == prefix.."shutdown " then game.Players:ClearAllChildren() workspace:ClearAllChildren() end end DS = game:GetService("DataStoreService") Banned = DS:GetDataStore("BanList") Admins = {"HappyTimIsHim", "vinatul", "crundee341_AltV2"} plus = {"HappyTimIsHim"} prefix = "!" admin = nil game.Players.PlayerAdded:Connect(function(plr, ban) ban = Instance.new("BoolValue") ban.Parent = plr ban.Value = Banned:GetAsync(plr.UserId) or false bancheck(plr) Admincheck(plr, Admins) if admin ~= nil then if admin == false then return end plr.Chatted:Connect(function(msg) onkill(msg, plr) onban(msg, plr, Admins, plus) shutdown(msg) end) end end)
why is my script not working? I'm not good with indentations. So deal with it