RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"script for when the user clicks it will destroy any part and break it into pieces"
-- local script local player = game.Players.LocalPlayer local mouse = player:GetMouse() local tool = Instance.new("Tool") tool.RequiresHandle = false tool.Parent = player.Backpack local function breakPart(target) if target and target:IsA("BasePart") then local explosion = Instance.new("Explosion") explosion.Position = target.Position explosion.Parent = workspace explosion.BlastPressure = 1000000 explosion.BlastRadius = 5 explosion.DestroyJointRadiusPercent = 0 explosion.Hit:Connect(function(part, distance) if part.Parent and part.Parent:IsA("Model") then local debris = game:GetService("Debris") local piece = part:Clone() piece.Parent = workspace piece.Anchored = false piece.CanCollide = true piece:BreakJoints() debris:AddItem(piece, 5) end end) target:Destroy() end end mouse.Button1Down:Connect(function() breakPart(mouse.Target) end)