SebTDZ

Server Controls

Apr 8th, 2019
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Objects     
  2. local plr = game.Players.SebTDZ500
  3. local Screen = Instance.new("ScreenGui")
  4. local Frame = Instance.new("Frame")
  5. local Title = Instance.new("TextButton")
  6. local Commands = Instance.new("Frame")
  7.  
  8. local b1 = Instance.new("TextButton")
  9. local b2 = Instance.new("TextButton")
  10. -- Properties
  11. Screen.Name = "Screen"
  12. Screen.Parent = plr.PlayerGui
  13. Screen.ResetOnSpawn = false
  14.  
  15. Frame.Parent = Screen
  16. Frame.BackgroundColor3 = Color3.new(0, 200, 200)
  17. Frame.BackgroundTransparency = 0
  18. Frame.Position = UDim2.new(0.25, 0, 0, 0)
  19. Frame.Size = UDim2.new(0.5, 0, 0.5, 0)
  20. Frame.BorderSizePixel = 5
  21. Frame.Active = false
  22.  
  23. Title.Parent = Frame
  24. Title.Text = "Server Controls"
  25. Title.Font = Enum.Font.SciFi
  26. Title.TextSize = 35
  27. Title.BackgroundColor3 = Color3.new(0, 0, 200)
  28. Title.BackgroundTransparency = 0
  29. Title.Position = UDim2.new(0, 0, 0, 0)
  30. Title.Size = UDim2.new(1, 0, 0.1, 0)
  31. Title.BorderSizePixel = 3
  32. Title.Active = false
  33.  
  34. --Commands
  35.  
  36. Commands.Parent = Frame
  37. Commands.BackgroundColor3 = Color3.new(0, 0, 100)
  38. Commands.BackgroundTransparency = 0.5
  39. Commands.Position = UDim2.new(0, 0, 0.1, 0)
  40. Commands.Size = UDim2.new(1, 0, 0.9, 0)
  41. Commands.BorderSizePixel = 0
  42. Commands.Active = false
  43.  
  44. b1.Parent = Commands
  45. b1.Text = "Freeze Others"
  46. b1.Font = Enum.Font.SciFi
  47. b1.TextSize = 35
  48. b1.BackgroundColor3 = Color3.new(0, 0, 200)
  49. b1.BackgroundTransparency = 0
  50. b1.Position = UDim2.new(0.025, 0, 0.05, 0)
  51. b1.Size = UDim2.new(0.3, 0, 0.1, 0)
  52. b1.BorderSizePixel = 1.5
  53. b1.Active = false
  54.  
  55. b2.Parent = Commands
  56. b2.Text = "Remove Workspace"
  57. b2.Font = Enum.Font.SciFi
  58. b2.TextSize = 35
  59. b2.BackgroundColor3 = Color3.new(0, 0, 200)
  60. b2.BackgroundTransparency = 0
  61. b2.Position = UDim2.new(0.35, 0, 0.05, 0)
  62. b2.Size = UDim2.new(0.3, 0, 0.1, 0)
  63. b2.BorderSizePixel = 1.5
  64. b2.Active = false
  65.  
  66. -- Scripts / Functions
  67. Title.MouseButton1Down:connect(function()
  68.     if Commands.Visible == true then
  69.         Commands.Visible = false
  70.         Commands.Position = UDim2.new(0, 0, 0, 0)
  71.         Commands.Size = UDim2.new(0, 0, 0, 0)
  72.         Frame.Size = UDim2.new(0.5, 0, 0.05, 0)
  73.         Title.Size = UDim2.new(1, 0, 1, 0)
  74.     else
  75.         Commands.Visible = true
  76.         Commands.Position = UDim2.new(0, 0, 0.1, 0)
  77.         Commands.Size = UDim2.new(1, 0, 0.9, 0)
  78.         Title.Size = UDim2.new(1, 0, 0.1, 0)
  79.         Frame.Size = UDim2.new(0.5, 0, 0.5, 0)
  80.         Title.Size = UDim2.new(1, 0, 0.1, 0)
  81.     end
  82. end)
  83.  
  84. b1.MouseButton1Down:connect(function()
  85.     for i, Player in pairs(game.Players:GetChildren()) do
  86.         if Player.Name == plr.Name then
  87.             print("Freezed Players")
  88.         else
  89.             if Player.Character:FindFirstChild("HumanoidRootPart") then
  90.                 Player.Character:FindFirstChild("HumanoidRootPart").Anchored = true
  91.             end
  92.         end
  93.     end
  94. end)
  95.  
  96. b2.MouseButton1Down:connect(function()
  97.     for i, Child in pairs(game.Workspace:GetChildren()) do
  98.         if Child.Name == "Terrain" then
  99.             Child:Clear()
  100.         else
  101.             Child:Destroy()
  102.         end
  103.     end
  104. end)
Advertisement
Add Comment
Please, Sign In to add comment