memberhero

Untitled

May 1st, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. local Tool = script.Parent;
  2.  
  3. enabled = true
  4.  
  5. shooting = false
  6. reloadtime = 0
  7.  
  8. local bubble = nil
  9.  
  10. function TakeStick()
  11. Tool.GripForward = Vector3.new(0,-.759,-.651)
  12. Tool.GripPos = Vector3.new(1.25,-.5,.2)
  13. Tool.GripRight = Vector3.new(.971,-.156,.181)
  14. Tool.GripUp = Vector3.new(.239,.632,-.737)
  15. end
  16.  
  17. function RestoreStick()
  18. Tool.GripForward = Vector3.new(-.776,.163,-.609)
  19. Tool.GripPos = Vector3.new(0.05,-.15,.1)
  20. Tool.GripRight = Vector3.new(.614,-.0269,-.789)
  21. Tool.GripUp = Vector3.new(.145,.986,.079)
  22. end
  23.  
  24. function onEquipped()
  25. Tool.Handle.OpenSound:play()
  26. end
  27.  
  28.  
  29. function BlowBubble(head)
  30. if (bubble == nil) then
  31. bubble = Instance.new("Part")
  32. bubble.Shape = 0
  33. bubble.Size = Vector3.new(1,1,1)
  34. bubble.BrickColor = BrickColor.new(1016)
  35. bubble.Transparency = .3
  36. bubble.TopSurface = 0
  37. bubble.BottomSurface = 0
  38. bubble.Position = head.Position + (head.CFrame.lookVector * .5)
  39.  
  40. local mesh = Instance.new("SpecialMesh")
  41. mesh.MeshType = 3
  42. mesh.Parent = bubble
  43. bubble.Parent = game.Workspace
  44.  
  45. local bp = Instance.new("BodyPosition")
  46. bp.maxForce = Vector3.new(1e8,1e8,1e8)
  47. bp.position = bubble.Position
  48. bp.Parent = bubble
  49. end
  50.  
  51. bubble.BodyPosition.position = head.Position + (head.CFrame.lookVector * (.6 + (bubble.Mesh.Scale.x * .5)))
  52. bubble.Mesh.Scale = bubble.Mesh.Scale + Vector3.new(.1,.1,.1)
  53. end
  54.  
  55.  
  56. Tool = script.Parent
  57.  
  58.  
  59. function onActivated(mouse)
  60. if reloadtime > 0 then return end
  61. if shooting == true then return end
  62.  
  63. reloadtime = 1.0
  64. shooting = true
  65.  
  66. local time = 0
  67.  
  68. local character = Tool.Parent;
  69. local humanoid = character.Humanoid
  70. if humanoid == nil then
  71. print("Humanoid not found")
  72. return
  73. end
  74.  
  75. TakeStick()
  76.  
  77. local sound = character.PrimaryPart:findFirstChild("InflateSound")
  78. if sound == nil then
  79. sound = Instance.new("Sound")
  80. sound.Name = "InflateSound"
  81. sound.SoundId = "http://www.roblox.com/asset/?id=11895499"
  82. sound.Parent = character.PrimaryPart
  83. end
  84. wait(.5)
  85. sound:Play()
  86.  
  87.  
  88. RestoreStick()
  89.  
  90. while shooting == true do
  91.  
  92.  
  93.  
  94. BlowBubble(character.Head)
  95. wait(.05)
  96. time = time + .05
  97. if time > 2.0 then shooting = false end
  98. end
  99.  
  100. if (bubble ~= nil) then
  101. bubble:Remove()
  102. bubble = nil
  103. end
  104.  
  105. sound:Stop()
  106.  
  107. local psound = character.PrimaryPart:findFirstChild("PopSound")
  108. if psound == nil then
  109. psound = Instance.new("Sound")
  110. psound.Name = "PopSound"
  111. psound.SoundId = "http://www.roblox.com/asset/?id=11895500"
  112. psound.Parent = character.PrimaryPart
  113. end
  114. psound:Play()
  115.  
  116. wait(reloadtime)
  117. reloadtime = 0
  118.  
  119.  
  120. end
  121.  
  122. function onDeactivated(mouse)
  123. shooting = false
  124. end
  125.  
  126.  
  127. script.Parent.Activated:connect(onActivated)
  128. script.Parent.Deactivated:connect(onDeactivated)
Add Comment
Please, Sign In to add comment