Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Click Destroy Tool (LocalScript)
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- -- Create tool GUI for activation
- local toolGui = Instance.new("ScreenGui")
- toolGui.Name = "ClickDestroyTool"
- toolGui.Parent = player:WaitForChild("PlayerGui")
- -- Create button to activate tool
- local activateButton = Instance.new("TextButton")
- activateButton.Size = UDim2.new(0, 200, 0, 50)
- activateButton.Position = UDim2.new(0.5, -100, 0, 10)
- activateButton.Text = "Activate Click Destroy Tool"
- activateButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- activateButton.Parent = toolGui
- -- Tool active state
- local toolActive = false
- activateButton.MouseButton1Click:Connect(function()
- toolActive = not toolActive
- if toolActive then
- activateButton.Text = "Deactivate Click Destroy Tool"
- else
- activateButton.Text = "Activate Click Destroy Tool"
- end
- end)
- -- Function to destroy part and create explosion effect
- local function clickDestroy(part)
- -- Create explosion effect
- local explosion = Instance.new("Explosion")
- explosion.Position = part.Position
- explosion.BlastRadius = 5
- explosion.BlastPressure = 500
- explosion.Parent = workspace
- -- Create a visual explosion effect
- local explosionEffect = Instance.new("ParticleEmitter")
- explosionEffect.Texture = "rbxassetid://243396542" -- Explosion effect texture
- explosionEffect.Size = NumberSequence.new(2)
- explosionEffect.Lifetime = NumberRange.new(0.5)
- explosionEffect.Rate = 100
- explosionEffect.Parent = part
- -- Destroy part after a short delay
- game.Debris:AddItem(explosionEffect, 0.5)
- game.Debris:AddItem(part, 0.5)
- end
- -- Detect clicks on objects and trigger destroy
- mouse.Button1Down:Connect(function()
- if toolActive then
- local target = mouse.Target
- if target and target:IsA("BasePart") then
- clickDestroy(target)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement