derekiscool423

rocket

Dec 16th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. me = game.Players.LocalPlayer
  2.  
  3. if script.Parent.className ~= "HopperBin" then
  4. h = Instance.new("HopperBin")
  5. h.Parent = me.Backpack
  6. h.Name = "Rocket"
  7. script.Parent = h
  8. end
  9.  
  10. sp = script.Parent
  11.  
  12. hold = false
  13. miss = {}
  14. function selected(mouse, key)
  15. mouse.Button1Down:connect(function()
  16. if hold == true then return end
  17. hold = true
  18. local missile = Instance.new("Part")
  19. missile.Parent = workspace
  20. missile.formFactor = 0
  21. missile.Size = Vector3.new(0.1,0.1,1)
  22. missile.Anchored = true
  23. missile.CFrame = CFrame.new(me.Character.Torso.Position, mouse.Hit.p) * CFrame.new(1,1,-17)
  24. workspace.CurrentCamera.CameraSubject = missile
  25. table.insert(miss,missile)
  26. while hold == true do
  27. wait()
  28. missile.CFrame = CFrame.new(missile.Position, mouse.Hit.p)
  29. missile.CFrame = missile.CFrame * CFrame.new(0,0,-1)
  30. end
  31. end)
  32. mouse.Button1Up:connect(function()
  33. hold = false
  34. local ex = Instance.new("Explosion")
  35. ex.Parent = workspace
  36. ex.Position = miss[1].Position
  37. ex.BlastRadius = miss[1]:GetMass()
  38. ex.BlastPressure = 400000
  39. miss[1]:remove()
  40. table.remove(miss, 1)
  41. workspace.CurrentCamera.CameraSubject = me.Character.Humanoid
  42. end)
  43. end
  44.  
  45. sp.Selected:connect(selected)
Add Comment
Please, Sign In to add comment