Advertisement
Elvisfofo_rblx

Click Destroy Tool

Jun 22nd, 2025
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. --// Click Destroy Tool (LocalScript)
  2. local player = game.Players.LocalPlayer
  3. local mouse = player:GetMouse()
  4.  
  5. -- Create tool GUI for activation
  6. local toolGui = Instance.new("ScreenGui")
  7. toolGui.Name = "ClickDestroyTool"
  8. toolGui.Parent = player:WaitForChild("PlayerGui")
  9.  
  10. -- Create button to activate tool
  11. local activateButton = Instance.new("TextButton")
  12. activateButton.Size = UDim2.new(0, 200, 0, 50)
  13. activateButton.Position = UDim2.new(0.5, -100, 0, 10)
  14. activateButton.Text = "Activate Click Destroy Tool"
  15. activateButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
  16. activateButton.Parent = toolGui
  17.  
  18. -- Tool active state
  19. local toolActive = false
  20.  
  21. activateButton.MouseButton1Click:Connect(function()
  22. toolActive = not toolActive
  23. if toolActive then
  24. activateButton.Text = "Deactivate Click Destroy Tool"
  25. else
  26. activateButton.Text = "Activate Click Destroy Tool"
  27. end
  28. end)
  29.  
  30. -- Function to destroy part and create explosion effect
  31. local function clickDestroy(part)
  32. -- Create explosion effect
  33. local explosion = Instance.new("Explosion")
  34. explosion.Position = part.Position
  35. explosion.BlastRadius = 5
  36. explosion.BlastPressure = 500
  37. explosion.Parent = workspace
  38.  
  39. -- Create a visual explosion effect
  40. local explosionEffect = Instance.new("ParticleEmitter")
  41. explosionEffect.Texture = "rbxassetid://243396542" -- Explosion effect texture
  42. explosionEffect.Size = NumberSequence.new(2)
  43. explosionEffect.Lifetime = NumberRange.new(0.5)
  44. explosionEffect.Rate = 100
  45. explosionEffect.Parent = part
  46.  
  47. -- Destroy part after a short delay
  48. game.Debris:AddItem(explosionEffect, 0.5)
  49. game.Debris:AddItem(part, 0.5)
  50. end
  51.  
  52. -- Detect clicks on objects and trigger destroy
  53. mouse.Button1Down:Connect(function()
  54. if toolActive then
  55. local target = mouse.Target
  56. if target and target:IsA("BasePart") then
  57. clickDestroy(target)
  58. end
  59. end
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement