Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. -- Instances:
  2. local MenuGui = Instance.new("ScreenGui")
  3. local BackGround = Instance.new("Frame")
  4. local ActivatedLabel = Instance.new("TextLabel")
  5. local ActiveButtom = Instance.new("TextButton")
  6. local canDestroy = false
  7. local player = game:GetService("Players").LocalPlayer
  8. local mouse = player:GetMouse()
  9. local mouseHIT = nil
  10. local inputService = game:GetService("UserInputService")
  11.  
  12. local KEY_TO_DELET = Enum.KeyCode.E
  13.  
  14. --Properties:
  15. MenuGui.Name = "MenuGui"
  16. MenuGui.Parent = player.PlayerGui
  17. MenuGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  18. MenuGui.ResetOnSpawn = false
  19.  
  20. BackGround.Name = "BackGround"
  21. BackGround.Parent = MenuGui
  22. BackGround.BackgroundColor3 = Color3.new(0.105882, 0.0901961, 0.0901961)
  23. BackGround.BorderColor3 = Color3.new(1, 1, 1)
  24. BackGround.Position = UDim2.new(0.01390923, 0, 0.598101199, 0)
  25. BackGround.Size = UDim2.new(0, 102, 0, 76)
  26.  
  27. ActivatedLabel.Name = "ActivatedLabel"
  28. ActivatedLabel.Parent = BackGround
  29. ActivatedLabel.BackgroundColor3 = Color3.new(0.105882, 0.0901961, 0.0901961)
  30. ActivatedLabel.BorderColor3 = Color3.new(1, 1, 1)
  31. ActivatedLabel.BorderSizePixel = 0
  32. ActivatedLabel.Position = UDim2.new(0.0294117648, 0, 0.105263159, 0)
  33. ActivatedLabel.Size = UDim2.new(0, 95, 0, 25)
  34. ActivatedLabel.Font = Enum.Font.Arial
  35. ActivatedLabel.Text = "CanDestroy: FALSE"
  36. ActivatedLabel.TextColor3 = Color3.new(1, 0, 0.0156863)
  37. ActivatedLabel.TextScaled = true
  38. ActivatedLabel.TextSize = 20
  39. ActivatedLabel.TextWrapped = true
  40.  
  41. ActiveButtom.Name = "ActiveButtom"
  42. ActiveButtom.Parent = BackGround
  43. ActiveButtom.BackgroundColor3 = Color3.new(0.105882, 0.0901961, 0.0901961)
  44. ActiveButtom.BorderColor3 = Color3.new(1, 1, 1)
  45. ActiveButtom.Position = UDim2.new(0.0582493618, 0, 0.603514373, 0)
  46. ActiveButtom.Size = UDim2.new(0, 89, 0, 22)
  47. ActiveButtom.Font = Enum.Font.Arial
  48. ActiveButtom.Text = "Active"
  49. ActiveButtom.TextColor3 = Color3.new(1, 1, 1)
  50. ActiveButtom.TextScaled = true
  51. ActiveButtom.TextSize = 14
  52. ActiveButtom.TextWrapped = true
  53.  
  54. -- Scripts:
  55.  
  56. while wait() do
  57. ActiveButtom.MouseButton1Click:Connect(function()
  58. if canDestroy == false then
  59. canDestroy = true
  60. ActivatedLabel.Text = "CanDestroy: TRUE"
  61. ActivatedLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
  62. elseif canDestroy == true then
  63. canDestroy = false
  64. ActivatedLabel.Text = "CanDestroy: FALSE"
  65. ActivatedLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  66. end
  67. end)
  68. inputService.InputBegan:Connect(function(key)
  69. if key.KeyCode == KEY_TO_DELET and canDestroy == true and mouseHIT == nil then
  70. mouseHIT = mouse.Target
  71. mouseHIT:Destroy()
  72. mouseHIT = nil
  73. end
  74. end)
  75. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement