SHARE
TWEET

Simple Admin Commands By 0Care

a guest Apr 20th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. --Say "-cmds" for commands. Change 0Care to your name.
  3.  
  4. local Admino = "0Care"
  5.  
  6. game.Players[Admino].Chatted:Connect(function(Message)
  7.     if Message ~= nil then
  8.         if Message == "-shutdown" then
  9.             for i,v in pairs(game.Players:GetPlayers()) do
  10.                 if v:IsA("Player") then
  11.                     v:Kick("Server Shutdown")
  12.                 end
  13.             end
  14.         end    
  15.     end
  16. end)
  17.  
  18. game.Players[Admino].Chatted:Connect(function(Message)
  19.     if Message ~= nil then
  20.         if Message == "-kickothers" then
  21.             for i,v in pairs(game.Players:GetPlayers()) do
  22.                 if v:IsA("Player") then
  23.                     if v.Name ~= game.Players[Admino].Name then
  24.                         v:Kick("Kicked")
  25.                     end
  26.                 end
  27.             end
  28.         end    
  29.     end
  30. end)
  31.  
  32. game.Players[Admino].Chatted:Connect(function(Message)
  33.     if Message ~= nil then
  34.         if Message == "-lock" then
  35.             local m = Instance.new("Message" , workspace)
  36. m.Text = "Server Locked"
  37. repeat
  38. for i,v in pairs(game.Players:GetPlayers()) do
  39. if v:IsA("Player") then
  40. if v.Name ~= Admino then
  41. v:Kick("Server Locked")
  42. end end end
  43. wait(0.3)
  44. until false
  45.         end    
  46.     end
  47. end)
  48.  
  49. game.Players[Admino].Chatted:Connect(function(Message)
  50.     if Message ~= nil then
  51.         if Message.lower(string.sub(Message, 1, 5)) == "-kick" then
  52.             local Target = game.Players:FindFirstChild(string.sub(Message, 7))
  53.             Target:Kick()
  54.         end    
  55.     end
  56. end)
  57.  
  58. game.Players[Admino].Chatted:Connect(function(Message)
  59.     if Message ~= nil then
  60.         if Message.lower(string.sub(Message, 1, 4)) == "-ban" then
  61.             local Target = game.Players:FindFirstChild(string.sub(Message, 6))
  62.             repeat
  63.             for i,v in pairs(game.Players:GetPlayers()) do
  64.             if v:IsA("Player") then
  65.             if v.Name == Target.Name then
  66.             v:Kick("Banned!")
  67.             end end end
  68.             wait(0.3)
  69.             until false
  70.         end    
  71.     end
  72. end)
  73.  
  74. game.Players[Admino].Chatted:Connect(function(Message)
  75.     if Message ~= nil then
  76.         if Message.lower(string.sub(Message, 1, 4)) == "-kill" then
  77.             local Target = game.Players:FindFirstChild(string.sub(Message, 6))
  78.             Target.Character.Humanoid.Health = 0
  79.         end    
  80.     end
  81. end)
  82.  
  83. game.Players[Admino].Chatted:Connect(function(Message)
  84.     if Message ~= nil then
  85.         if Message == "-cmds" then
  86.             local ScreenGui = Instance.new("ScreenGui")
  87.             local TextLabel = Instance.new("TextLabel")
  88.             local TextLabel_2 = Instance.new("TextButton")
  89.  
  90.             ScreenGui.Parent = game.Players[Admino].PlayerGui
  91.             ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  92.  
  93.             TextLabel.Parent = ScreenGui
  94.                 TextLabel.BackgroundColor3 = Color3.new(0.101961, 0.101961, 0.101961)
  95.                 TextLabel.BackgroundTransparency = 0.5
  96.                 TextLabel.Position = UDim2.new(0.200601801, 0, 0.192878336, 0)
  97.                 TextLabel.Size = UDim2.new(0, 373, 0, 419)
  98.                 TextLabel.Font = Enum.Font.SourceSans
  99.             TextLabel.Text = "You MUST use full name. The command prefix is - , The commands are -kill              {player}, -ban   {player}, -kick {player}, -kickothers , -lock , -shutdown"
  100.                 TextLabel.TextColor3 = Color3.new(0, 0, 0)
  101.             TextLabel.TextScaled = true
  102.             TextLabel.TextSize = 14
  103.                 TextLabel.TextWrapped = true
  104.  
  105.             TextLabel_2.Parent = ScreenGui
  106.             TextLabel_2.BackgroundColor3 = Color3.new(1, 0, 0)
  107.             TextLabel_2.Position = UDim2.new(0.419558668, 0, 0.118694365, 0)
  108.             TextLabel_2.Size = UDim2.new(0, 55, 0, 50)
  109.             TextLabel_2.Font = Enum.Font.SourceSans
  110.             TextLabel_2.Text = "X"
  111.             TextLabel_2.TextColor3 = Color3.new(0, 0, 0)
  112.             TextLabel_2.TextScaled = true
  113.             TextLabel_2.TextSize = 14
  114.             TextLabel_2.TextWrapped = true
  115.            
  116.             TextLabel_2.MouseButton1Click:Connect(function()
  117.             TextLabel_2:Remove()
  118.             TextLabel:Remove()
  119.             end)
  120.         end    
  121.     end
  122. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top