Advertisement
Welliew

test

May 11th, 2022 (edited)
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.65 KB | None | 0 0
  1. local AdminPrefix = ";"
  2. local Players = game:GetService("Players")
  3. local LocalP = Players.LocalPlayer;
  4. local banned = {}
  5. local actualnoobs = {}
  6. local UserId = LocalP.UserId
  7. for i,v in ipairs(banned) do
  8.     if LocalP.Name == v then
  9.         LocalP:Kick("L")    
  10.     end
  11. end
  12.  
  13. getgenv().AdminTable = {
  14.   [UserId] = {["Access"] = 5}; -- ice monkey
  15. }
  16.  
  17.  
  18. getgenv().psearch = function(Name)
  19.   local Inserted = {}
  20.   for _, p in pairs(Players:GetPlayers()) do
  21.       if string.lower(string.sub(p.Name,1, string.len(Name))) == string.lower(Name) then
  22.           table.insert(Inserted, p);return p
  23.       end
  24.   end
  25. end -- Simple player finder function
  26.  
  27. getgenv().AdminCmdList = {
  28.   ["kick"] = {
  29.       ["CommandFunc"] = function(Player, self, CmdPlayer)
  30.           if Player == LocalP or Player == "all" then
  31.               LocalP:Kick(self)
  32.           end
  33.       end;
  34.       ["Clearence"] = {[5] = true;[4] = true;};
  35.   }; -- you can make new ones of these (the ; have to be in the same spots)
  36.   ["kill"] = {
  37.       ["CommandFunc"] = function(Player, self, CmdPlayer)
  38.           if Player == LocalP or Player == "all" then
  39.               LocalP.Character.Humanoid:ChangeState(15)
  40.           end
  41.       end;
  42.       ["Clearence"] = {[4] = true;[5] = true;[3] = true;};
  43.   };
  44.     ["summon"] = {
  45.       ["CommandFunc"] = function(Player, self, CmdPlayer)
  46.           if Player == LocalP or Player == "all" then
  47.               game.Players[Player.Name].Character:SetPrimaryPartCFrame(game.Players[CmdPlayer.Name].Character.HumanoidRootPart.CFrame)
  48.           end
  49.       end;
  50.       ["Clearence"] = {[3] = true;[4] = true;[5] = true;};
  51.   };
  52.     ["safe"] = {
  53.         ["CommandFunc"] = function(Player, self, CmdPlayer)
  54.             if Player == LocalP or Player == "all" then
  55.                 game.Players[Player.Name].Character.HumanoidRootPart.CFrame = CFrame.new(-813.694214, 74.1816101, 418.476776)
  56.             end
  57.         end;
  58.         ["Clearence"] = {[4] = true;[5] = true;[3] = true;[1] = true;};
  59.    };
  60.     ["spawn"] = {
  61.         ["CommandFunc"] = function(Player, self, CmdPlayer)
  62.             if Player == LocalP or Player == "all" then
  63.                 game.Players[Player.Name].Character.HumanoidRootPart.CFrame = CFrame.new(55.2911453, 72.7331238, -328.640259)
  64.             end
  65.         end;
  66.         ["Clearence"] = {[4] = true;[5] = true;[3] = true;};
  67.    };
  68.     ["army"] = {
  69.         ["CommandFunc"] = function(Player, self, CmdPlayer)
  70.             if Player == LocalP or Player == "all" then
  71.                 for i,v in pairs(actualnoobs) do
  72.                     if Player.Name == v then
  73.                         game.Players[Player.Name].Character:SetPrimaryPartCFrame(game.Players[CmdPlayer.Name].Character.HumanoidRootPart.CFrame)
  74.                     end
  75.                 end
  76.             end
  77.         end;
  78.         ["Clearence"] = {[4] = true;[5] = true;};
  79.     };
  80. };
  81.  
  82. getgenv().BDCheck = function(Target2, Chat)
  83.   if Chat:sub(1, 1) == AdminPrefix then
  84.       local args = string.split(Chat:sub(2), " ")
  85.       local Command = AdminCmdList[table.remove(args, 1)]
  86.       local targ1 = psearch(table.remove(args, 1))
  87.       if Command and targ1 then -- Credits to !fishgang Cy for this BDCheck func
  88.           return Command and Command["Clearence"][AdminTable[Target2.UserId].Access] and Command["CommandFunc"](targ1, table.concat(args, " "), Target2)
  89.       end
  90.   end
  91. end
  92.  
  93. local GP = Players:GetPlayers()
  94. for i = 1, #GP do
  95.   local CoolKidPlayer = GP[i]
  96.   CoolKidPlayer.Chatted:Connect(function(Word)
  97.       BDCheck(CoolKidPlayer, Word)
  98.   end)
  99. end -- Checks if you chatted a command
  100. Players.PlayerAdded:Connect(function(CKP)
  101.   CKP.Chatted:Connect(function(Message)
  102.       BDCheck(CKP, Message)
  103.   end)
  104. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement