Advertisement
botchibo

Roblox Admin Script

Feb 25th, 2023
792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.40 KB | None | 0 0
  1. -- Create the GUI
  2. local screenGui = Instance.new("ScreenGui")
  3. screenGui.Name = "Admin GUI"
  4. screenGui.Parent = game.Players.LocalPlayer.PlayerGui
  5.  
  6. local frame = Instance.new("Frame")
  7. frame.Size = UDim2.new(0, 200, 0, 50)
  8. frame.Position = UDim2.new(0.5, -100, 0.5, -25)
  9. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  10. frame.Parent = screenGui
  11.  
  12. local label = Instance.new("TextLabel")
  13. label.Size = UDim2.new(1, 0, 0.5, 0)
  14. label.Position = UDim2.new(0, 0, 0, 0)
  15. label.Text = "Toggle Admin Privileges:"
  16. label.TextSize = 18
  17. label.TextColor3 = Color3.new(0, 0, 0)
  18. label.BackgroundTransparency = 1
  19. label.Parent = frame
  20.  
  21. local toggleButton = Instance.new("TextButton")
  22. toggleButton.Size = UDim2.new(1, 0, 0.5, 0)
  23. toggleButton.Position = UDim2.new(0, 0, 0.5, 0)
  24. toggleButton.Text = "Off"
  25. toggleButton.TextSize = 18
  26. toggleButton.BackgroundColor3 = Color3.new(1, 1, 1)
  27. toggleButton.BorderSizePixel = 0
  28. toggleButton.Parent = frame
  29.  
  30. -- Define the admin commands
  31. local adminCommands = {
  32.     "kill",
  33.     "respawn",
  34.     "explode",
  35.     "ban",
  36.     "kick",
  37. }
  38.  
  39. -- Define the toggle function
  40. local isAdmin = false
  41.  
  42. local function toggleAdmin()
  43.     isAdmin = not isAdmin
  44.    
  45.     if isAdmin then
  46.         toggleButton.Text = "On"
  47.        
  48.         -- Grant admin privileges
  49.         for _, command in ipairs(adminCommands) do
  50.             game:GetService("StarterGui"):SetCore("SendNotification", {
  51.                 Title = "Admin",
  52.                 Text = "Enabled " .. command .. " command",
  53.                 Duration = 3,
  54.             })
  55.             game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
  56.                 Text = "You now have admin privileges",
  57.                 Color = Color3.new(1, 1, 1),
  58.             })
  59.         end
  60.     else
  61.         toggleButton.Text = "Off"
  62.        
  63.         -- Remove admin privileges
  64.         for _, command in ipairs(adminCommands) do
  65.             game:GetService("StarterGui"):SetCore("SendNotification", {
  66.                 Title = "Admin",
  67.                 Text = "Disabled " .. command .. " command",
  68.                 Duration = 3,
  69.             })
  70.             game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
  71.                 Text = "Admin privileges have been removed",
  72.                 Color = Color3.new(1, 1, 1),
  73.             })
  74.         end
  75.     end
  76. end
  77.  
  78. -- Connect the toggle function to the button
  79. toggleButton.MouseButton1Click:Connect(toggleAdmin)
  80.  
Tags: Exploit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement