N0ePlox

Script

May 10th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. local boom = false
  2.  
  3. function createExplosion(position)
  4.  
  5. explosion = Instance.new("Explosion")
  6. explosion.Position = position
  7. explosion.BlastRadius = 12
  8. explosion.Parent = game.Workspace
  9.  
  10. end
  11.  
  12. function onTouch(part)
  13. if boom == true then return end
  14. if (part.Name == "Rocket") or (part.Name == "Safe") or (part.Parent.Parent.Parent == script.Parent) or (part.Parent:findFirstChild("Humanoid")) then return end
  15. if (script.Parent.Parts.Tip.Velocity.x > 50) or (script.Parent.Parts.Tip.Velocity.x < -50) or (script.Parent.Parts.Tip.Velocity.z > 50) or (script.Parent.Parts.Tip.Velocity.z < -50) then
  16. boom = true
  17. createExplosion(script.Parent.Parts.Engine.Position)
  18. script.Parent:BreakJoints()
  19. local stuff = script.Parent:children()
  20. for i=1,#stuff do
  21. if stuff[i].Name == "BodyKit" or
  22. stuff[i].Name == "Parts" then
  23. local parts = stuff[i]:children()
  24. for p = 1, #parts do
  25. if parts[p].className == "Part" then
  26. local velo = Instance.new("BodyVelocity")
  27. velo.maxForce = Vector3.new(9.9e+036, 9.9e+036, 9.9e+036)
  28. velo.velocity = Vector3.new(math.random(-15,15),math.random(-15,15),math.random(-15,15))
  29. velo.Parent = parts[p]
  30. end
  31. end
  32. end
  33. end
  34. wait(4)
  35. script.Parent:remove()
  36. end
  37. end
  38.  
  39. script.Parent.Parts.Tip.Touched:connect(onTouch)
Add Comment
Please, Sign In to add comment