Advertisement
moathon

ERGH. HAAAX Uhh?

Jul 21st, 2016
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. jool = Instance.new("Tool", game.Workspace)
  2. wait(1)
  3. jool.Parent = game.Workspace.firemomo45
  4. jool.Name = "Dr Hax's Computer"
  5. Randle = Instance.new("Part",jool)
  6. Randle.Name = "Handle"
  7. Randle.Anchored = true
  8. Voing = Instance.new("Sound",Randle)
  9. Voing.Name = "Boing"
  10. Voing.MaxDistance = 10000
  11. Voing.SoundId = "rbxassetid://142082167"
  12. Lesh = Instance.new("SpecialMesh",Randle)
  13. Lesh.MeshId = "http://www.roblox.com/asset/?id=11641931"
  14. Lesh.Scale = Vector3.new(2.2,2.2,2.2)
  15. Lesh.TextureId = "http://www.roblox.com/asset/?id=11641912"
  16. Bart = Instance.new("Part", jool)
  17. Bart.Anchored = true
  18. Bart.CanCollide = false
  19. Bart.Size = Vector3.new(.6,1.8,2)
  20. Haax = Instance.new("Sound", Bart)
  21. Haax.SoundId = "rbxassetid://143852292"
  22. Recal = Instance.new("Decal",Bart)
  23. Recal.Texture = "http://www.roblox.com/asset/?id=84645430"
  24. Recal.Face = 0
  25.  
  26. --Here comes the hard fucking part
  27. wait(1)
  28.  
  29. local Tool = jool
  30. local Ball = Randle
  31. head = Randle
  32. function onEquip()
  33. weld = Instance.new("Weld", Bart)
  34. weld.Part0 = head
  35. weld.C0 = head.CFrame:inverse()
  36. weld.Part1 = Bart
  37. weld.C1 = Bart.CFrame:inverse()
  38. Haax:Play()
  39. wait(1)
  40. Bart.Anchored = false
  41. head.Anchored = false
  42. end
  43. function Removed()
  44. Bart.Anchored = true
  45. head.Anchored = true
  46. end
  47.  
  48. jool.Equipped:connect(onEquip)
  49. jool.Unequipped:connect(Removed)
  50. function fire(direction)
  51.  
  52. Tool.Handle.Boing:Play()
  53.  
  54. local vCharacter = jool.Parent
  55. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  56.  
  57. local missile = Instance.new("Part")
  58. local spawnPos = vCharacter.PrimaryPart.Position
  59.  
  60. spawnPos = spawnPos + (direction * 5)
  61.  
  62. missile.Position = spawnPos
  63. missile.Size = Vector3.new(2,2,2)
  64. missile.Velocity = direction * 200
  65. missile.BrickColor = BrickColor.random()
  66. missile.Shape = 0
  67. missile.BottomSurface = 0
  68. missile.TopSurface = 0
  69. missile.Name = "Cannon Shot"
  70. missile.Elasticity = 1
  71. missile.Reflectance = .2
  72. missile.Friction = 0
  73.  
  74. Voing:clone().Parent = missile
  75. Lesh:clone().Parent = missile
  76.  
  77. local Ball = missile
  78. local damage = 25
  79.  
  80. local r = game:service("RunService")
  81. local debris = game:GetService("Debris")
  82.  
  83. local last_sound_time = r.Stepped:wait()
  84.  
  85. function onTouched(hit)
  86. if hit.Parent == nil then return end
  87. local now = r.Stepped:wait()
  88. if (now - last_sound_time > .1) then
  89. missile.Boing:play()
  90. last_sound_time = now
  91. else
  92. return
  93. end
  94.  
  95. local humanoid = hit.Parent:FindFirstChild("Humanoid")
  96. if humanoid ~=nil then
  97. tagHumanoid(humanoid)
  98. humanoid:TakeDamage(damage)
  99. local b = Instance.new("BillboardGui",hit.Parent.Torso)
  100. local img = Instance.new("ImageLabel",b)
  101. img.Image = "rbxassetid://109174960"
  102. img.BackgroundTransparency = 1
  103. b.Size = UDim2.new(8, 0, 4, 0)
  104. img.Size = UDim2.new(1, 10, 1, 10)
  105. b.Enabled = true
  106. img.Position = UDim2.new(0,0,-1,1)
  107. wait(0.5)
  108. if hit.Parent:FindFirstChild("Humanoid") then
  109. local s = Instance.new("Sound",hit.Parent.Torso)
  110. s.SoundId = "http://www.roblox.com/asset/?id=147722910"
  111. s.PlayOnRemove = true
  112.  
  113. wait(0.5)
  114.  
  115. if hit ~= nil then
  116. hit.Parent.Torso:Destroy()
  117. hit.Parent:Destroy()
  118. end
  119. end
  120. if connection then connection:disconnect() end
  121. else
  122. damage = damage / 2
  123. if damage < 2 then
  124. if connection then connection:disconnect() end
  125. end
  126. end
  127. end
  128.  
  129. function tagHumanoid(humanoid)
  130. local tag = missile:findFirstChild("creator")
  131. if tag ~= nil then
  132. local new_tag = tag:clone()
  133. new_tag.Parent = humanoid
  134. debris:AddItem(new_tag, 2)
  135. end
  136. end
  137.  
  138.  
  139. connection = missile.Touched:connect(onTouched)
  140.  
  141.  
  142.  
  143.  
  144. local creator_tag = Instance.new("ObjectValue")
  145. creator_tag.Value = vPlayer
  146. creator_tag.Name = "creator"
  147. creator_tag.Parent = missile
  148.  
  149. missile.Parent = game.Workspace
  150. end
  151.  
  152.  
  153.  
  154. jool.Enabled = true
  155. function onActivated()
  156. if not jool.Enabled then
  157. return
  158. end
  159. jool.Enabled = false
  160. local character = jool.Parent;
  161. local humanoid = character.Humanoid
  162. if humanoid == nil then
  163. print("Humanoid not found")
  164. return
  165. end
  166. local targetPos = humanoid.TargetPoint
  167. local lookAt = (targetPos - character.Head.Position).unit
  168. fire(lookAt)
  169. wait(0.5)
  170. jool.Enabled = true
  171. end
  172.  
  173.  
  174. Tool.Activated:connect(onActivated)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement