Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3. local Detail = 2
  4. Mouse.Button1Down:connect(function()
  5. if Mouse.Target and Mouse.Target:findFirstChild("Decal") then
  6. Mouse.Target.Decal:Destroy()
  7. end
  8. Holding = true
  9. end
  10. )
  11. Mouse.Button1Up:connect(function()
  12. Holding = false
  13. end
  14. )
  15. BreakApart = function(Part, Parent)
  16. local P = Part:clone()
  17. local P2 = Part:clone()
  18. P.BrickColor = BrickColor.Gray()
  19. P2.BrickColor = BrickColor.Red()
  20. if Part.Size.Y <= Part.Size.Z and Part.Size.X <= Part.Size.Z then
  21. P.Size = P.Size - Vector3.new(0, 0, P.Size.Z * 0.5)
  22. P2.Size = P.Size
  23. P.CFrame = Part.CFrame * CFrame.new(0, 0, P.Size.Z * 0.5)
  24. P2.CFrame = P.CFrame * CFrame.new(0, 0, -P.Size.Z)
  25. else
  26. if Part.Size.Z <= Part.Size.Y and Part.Size.X <= Part.Size.Y then
  27. P.Size = P.Size - Vector3.new(0, P.Size.Y * 0.5, 0)
  28. P2.Size = P.Size
  29. P.CFrame = Part.CFrame * CFrame.new(0, P.Size.Y * 0.5, 0)
  30. P2.CFrame = P.CFrame * CFrame.new(0, -P.Size.Y, 0)
  31. else
  32. P.Size = P.Size - Vector3.new(P.Size.X * 0.5, 0, 0)
  33. P2.Size = P.Size
  34. P.CFrame = Part.CFrame * CFrame.new(P.Size.X * 0.5, 0, 0)
  35. P2.CFrame = P.CFrame * CFrame.new(-P.Size.X, 0, 0)
  36. end
  37. end
  38. P.Parent = workspace
  39. P2.Parent = workspace
  40. P:MakeJoints()
  41. P2:MakeJoints()
  42. pcall(function()
  43. P:SetNetworkOwner(Player)
  44. end
  45. )
  46. pcall(function()
  47. P2:SetNetworkOwner(Player)
  48. end
  49. )
  50. delay(2, function()
  51. if P:GetMass() < Detail ^ 3 * 32.5 then
  52. if not P:GetRootPart() or P:GetRootPart():GetMass() < Detail ^ 3 * 65 then
  53. game:GetService("Debris"):AddItem(P, math.random(15, 40) / 15)
  54. end
  55. if not P2:GetRootPart() or P2:GetRootPart():GetMass() < Detail ^ 3 * 65 then
  56. game:GetService("Debris"):AddItem(P2, math.random(15, 40) / 15)
  57. end
  58. end
  59. end
  60. )
  61. Part:Destroy()
  62. end
  63.  
  64. workspace.ChildAdded:connect(function(Explos)
  65. repeat
  66. if Explos:IsA("Explosion") and Explos.Name == Player.Name then
  67. local Fragged = false
  68. 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)))
  69. for i = 1, #Found do
  70. local v = Found[i]
  71. if v.Name ~= "Baseplate" then
  72. if Detail < v.Size.X or Detail < v.Size.Y or Detail < v.Size.Z then
  73. v.Anchored = false
  74. BreakApart(v)
  75. Fragged = true
  76. else
  77. if math.random(2) == 1 and v:GetMass() < Detail ^ 3 * 32.5 then
  78. v:Destroy()
  79. end
  80. end
  81. end
  82. end
  83. end
  84. until not Fragged
  85. end
  86. )
  87. game:GetService("RunService").Stepped:connect(function()
  88. if Holding then
  89. local e = Instance.new("Explosion")
  90. e.BlastPressure = 3500000
  91. e.BlastRadius = 6
  92. e.Name = Player.Name
  93. e.Position = Mouse.hit.p
  94. e.Parent = workspace
  95. end
  96. end
  97. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement