Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local Detail = 2
- Mouse.Button1Down:connect(function()
- if Mouse.Target and Mouse.Target:findFirstChild("Decal") then
- Mouse.Target.Decal:Destroy()
- end
- Holding = true
- end
- )
- Mouse.Button1Up:connect(function()
- Holding = false
- end
- )
- BreakApart = function(Part, Parent)
- local P = Part:clone()
- local P2 = Part:clone()
- P.BrickColor = BrickColor.Gray()
- P2.BrickColor = BrickColor.Red()
- if Part.Size.Y <= Part.Size.Z and Part.Size.X <= Part.Size.Z then
- P.Size = P.Size - Vector3.new(0, 0, P.Size.Z * 0.5)
- P2.Size = P.Size
- P.CFrame = Part.CFrame * CFrame.new(0, 0, P.Size.Z * 0.5)
- P2.CFrame = P.CFrame * CFrame.new(0, 0, -P.Size.Z)
- else
- if Part.Size.Z <= Part.Size.Y and Part.Size.X <= Part.Size.Y then
- P.Size = P.Size - Vector3.new(0, P.Size.Y * 0.5, 0)
- P2.Size = P.Size
- P.CFrame = Part.CFrame * CFrame.new(0, P.Size.Y * 0.5, 0)
- P2.CFrame = P.CFrame * CFrame.new(0, -P.Size.Y, 0)
- else
- P.Size = P.Size - Vector3.new(P.Size.X * 0.5, 0, 0)
- P2.Size = P.Size
- P.CFrame = Part.CFrame * CFrame.new(P.Size.X * 0.5, 0, 0)
- P2.CFrame = P.CFrame * CFrame.new(-P.Size.X, 0, 0)
- end
- end
- P.Parent = workspace
- P2.Parent = workspace
- P:MakeJoints()
- P2:MakeJoints()
- pcall(function()
- P:SetNetworkOwner(Player)
- end
- )
- pcall(function()
- P2:SetNetworkOwner(Player)
- end
- )
- delay(2, function()
- if P:GetMass() < Detail ^ 3 * 32.5 then
- if not P:GetRootPart() or P:GetRootPart():GetMass() < Detail ^ 3 * 65 then
- game:GetService("Debris"):AddItem(P, math.random(15, 40) / 15)
- end
- if not P2:GetRootPart() or P2:GetRootPart():GetMass() < Detail ^ 3 * 65 then
- game:GetService("Debris"):AddItem(P2, math.random(15, 40) / 15)
- end
- end
- end
- )
- Part:Destroy()
- end
- workspace.ChildAdded:connect(function(Explos)
- repeat
- if Explos:IsA("Explosion") and Explos.Name == Player.Name then
- local Fragged = false
- local Found = workspace:FindPartsInRegion3(Region3.new(Explos.Position - Vector3.new(Explos.BlastRadius, Explos.BlastRadius, Explos.BlastRadius), Explos.Position + Vector3.new(Explos.BlastRadius, Explos.BlastRadius, Explos.BlastRadius)))
- for i = 1, #Found do
- local v = Found[i]
- if v.Name ~= "Baseplate" then
- if Detail < v.Size.X or Detail < v.Size.Y or Detail < v.Size.Z then
- v.Anchored = false
- BreakApart(v)
- Fragged = true
- else
- if math.random(2) == 1 and v:GetMass() < Detail ^ 3 * 32.5 then
- v:Destroy()
- end
- end
- end
- end
- end
- until not Fragged
- end
- )
- game:GetService("RunService").Stepped:connect(function()
- if Holding then
- local e = Instance.new("Explosion")
- e.BlastPressure = 3500000
- e.BlastRadius = 6
- e.Name = Player.Name
- e.Position = Mouse.hit.p
- e.Parent = workspace
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement