Guest User

Untitled

a guest
Jan 21st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. local plr = game:service'Players'.LocalPlayer
  2. local char = plr.Character
  3. local mouse = plr:GetMouse()
  4. local humanoid = char:findFirstChild("Humanoid")
  5. local torso = char:findFirstChild("Torso")
  6. local head = char.Head
  7. local cam = workspace.CurrentCamera
  8. mouse.Button1Down:connect(function()
  9. hit = mouse.Target
  10. if hit ~= nil and hit.Name ~= "Base" then
  11. hit:BreakJoints()
  12. hit.Anchored = false
  13. local bp = Instance.new("BodyPosition", hit)
  14. bp.maxForce = Vector3.new(hit:GetMass()*196.2, hit:GetMass()*196.2,hit:GetMass()*196.2)
  15. bp.D = 500
  16. for _ = 0, 2 do
  17. local p = Instance.new("Part", char)
  18. p.BrickColor = BrickColor.random()
  19. p.Shape = "Ball"
  20. p.FormFactor = "Custom"
  21. p.CFrame = hit.CFrame * CFrame.new(math.random(-1, 1),math.random(-1, 1),math.random(-1, 1))
  22. local bp2 = Instance.new("BodyPosition", p)
  23. bp2.maxForce = Vector3.new(p:GetMass()*196.2, p:GetMass()*196.2,p:GetMass()*196.2)
  24. bp2.D = 3000
  25. bp2.position = head.Position
  26. p.Size = Vector3.new(0.5, 0.5, 0.5)
  27. game:service'Debris':AddItem(p, 1)
  28. end
  29. while hit ~= nil and wait() do
  30. if bp ~= nil then
  31. bp.position = torso.Position
  32. end
  33. if (hit.Position - torso.Position).magnitude < 4 then
  34. hit:Destroy()
  35. break
  36. end
  37. end
  38. end
  39. end)
Add Comment
Please, Sign In to add comment