Advertisement
DylanD2003

Untitled

Jun 26th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.07 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local char = plr.Character
  3. local mouse = plr:GetMouse()
  4. local torso = char.Torso
  5. local head = char.Head
  6. local ra = char["Right Arm"]
  7. local la = char["Left Arm"]
  8. local rl = char["Right Leg"]
  9. local ll = char["Left Leg"]
  10. local human = char["Humanoid"]
  11. local camera = workspace.CurrentCamera
  12. local rs = torso:findFirstChild("Right Shoulder")
  13. local ls = torso:findFirstChild("Left Shoulder")
  14. local neck = torso:findFirstChild("Neck")
  15. local NO_moar_shooting = false
  16. local RunService = game:service'RunService'
  17. local ammo = 999999999999
  18.  
  19.  
  20. local sound = Instance.new("Sound", head)
  21. sound.SoundId = "http://roblox.com/asset/?id=11944350"
  22. sound.Volume = 1
  23. local reloads = Instance.new("Sound", head)
  24. reloads.SoundId = "http://roblox.com/asset/?id=106626233"
  25. reloads.Volume = 1
  26. local activate = Instance.new("Sound", head)
  27. activate.SoundId = "http://roblox.com/asset/?id=106626233"
  28. activate.Volume = 1
  29.  
  30.  
  31. local equipped = false
  32.  
  33. local debounce = false
  34.  
  35. local face = head.face
  36.  
  37.  
  38. release = Instance.new("Part", nil)
  39. release.FormFactor = "Custom"
  40. release.Size = Vector3.new(0.0, 0.0, 0.0)
  41. release.BrickColor = BrickColor.Black()
  42. local weld = Instance.new("Weld", release)
  43. weld.Part0 = release
  44. release.Locked = true
  45. weld.Part1 = head
  46. weld.C0 = CFrame.new(0, -0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  47. local mesh = Instance.new("CylinderMesh", release)
  48.  
  49. release2 = Instance.new("Part", nil)
  50. release2.FormFactor = "Custom"
  51. release2.Size = Vector3.new(0.0, 0.0, 0.0)
  52. release2.BrickColor = BrickColor.Black()
  53. release2.Locked = true
  54. local weld2 = Instance.new("Weld", release2)
  55. weld2.Part0 = release2
  56. weld2.Part1 = head
  57. weld2.C0 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
  58. local mesh2 = Instance.new("CylinderMesh", release2)
  59.  
  60. headext = Instance.new("Part", nil)
  61. headext.Position = torso.Position
  62. headext.FormFactor = "Custom"
  63. headext.Transparency = 1
  64. headext:BreakJoints()
  65. headext.Size = Vector3.new(2, 1, 1)
  66. headextw = Instance.new("Weld", headext)
  67. headextw.C0 = CFrame.new(Vector3.new(0, 1.5, 0))
  68. headextw.Part0 = torso
  69. headextw.Part1 = headext
  70. headextw.C1 = CFrame.new()
  71. headweld = Instance.new("Weld", headext)
  72. game:service("RunService").Stepped:connect(function()
  73. headweld.C0 = CFrame.new(Vector3.new(0,0,0), torso.CFrame:pointToObjectSpace(mouse.Hit.p)) * CFrame.Angles(0, 0, 0)
  74. end)
  75. headweld.Part0 = headext
  76. headweld.C1 = CFrame.new()
  77. headweld.Part1 = head
  78.  
  79. local Screen = Instance.new("ScreenGui", plr:findFirstChild("PlayerGui"))
  80. local TextBox = Instance.new("TextLabel", Screen)
  81. TextBox.Position = UDim2.new(0.1, 0, 0.95, 0)
  82. TextBox.Size = UDim2.new(0, 200, 0.05, 0)
  83. TextBox.BackgroundTransparency = 1
  84. game:service'RunService'.Stepped:connect(function()
  85. TextBox.Text = ("Ammo: "..ammo)
  86. end)
  87. TextBox.Font = "SourceSansBold"
  88. TextBox.TextColor3 = Color3.new(1, 1, 1)
  89. TextBox.FontSize = "Size36"
  90. TextBox.TextStrokeTransparency = 0
  91.  
  92. local pl = Instance.new("PointLight", release)
  93. pl.Range = 16
  94. pl.Brightness = 5
  95. pl.Color = Color3.new(1, 199/255, 67/255)
  96. pl.Enabled = false
  97. function reload()
  98. if ammo > 7 then return end
  99. reloads:play()
  100. ammo = ammo + 1
  101. activate:play()
  102. wait(0.3)
  103. debounce = false
  104. end
  105.  
  106. mouse.KeyDown:connect(function(key)
  107. if key == "r" then
  108. if debounce then return end
  109. if not equipped then return end
  110. if ammo > 7 then return end
  111. debounce = true
  112. reload()
  113. end
  114.  
  115. if key == "q" then
  116. equipped = not equipped
  117. if equipped then
  118. headext.Parent = char
  119. release.Parent = char
  120. release2.Parent = char
  121. for scale = 0, 1, 0.2 do
  122. weld2.C0 = CFrame.new(0, -scale + 0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
  123. weld.C0 = CFrame.new(0, -scale + 0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  124. mesh.Scale = Vector3.new(1, scale, 1)
  125. mesh2.Scale = Vector3.new(1, scale, 1)
  126. wait()
  127. end
  128. else
  129. face.Parent = head
  130. release.Parent = nil
  131. release2.Parent = nil
  132. headext.Parent = nil
  133. end
  134. end
  135. end)
  136.  
  137. mouse.Button1Down:connect(function()
  138. if not equipped then return end
  139. if ammo < 1 then return end
  140. if debounce then return end
  141. debounce = true
  142. sound:play()
  143. pl.Enabled = true
  144. ammo = ammo - 1
  145. coroutine.wrap(function()
  146. wait(0.07)
  147. pl.Enabled = false
  148. end)()
  149. coroutine.wrap(function()
  150. for scale = 0.7, 1, 0.1 do
  151. mesh.Scale = Vector3.new(1, scale, 1)
  152. wait()
  153. end
  154. end)()
  155.  
  156. for bullet = 0, 5 do
  157. coroutine.wrap(function()
  158. if char.Humanoid.Health < 1 then return end
  159. local rayPart = Instance.new("Part")
  160. rayPart.Name = "RayPart"
  161. rayPart.BrickColor = BrickColor.Green()
  162. rayPart.Anchored = true
  163. rayPart.CanCollide = false
  164. rayPart.Locked = true
  165. rayPart.TopSurface = Enum.SurfaceType.Smooth
  166. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  167. rayPart.formFactor = Enum.FormFactor.Custom
  168. rayPart.Size = Vector3.new(0.2, 0.2, 4)
  169. Instance.new("BlockMesh", rayPart).Scale = Vector3.new(0.2, 0.2, 0.5)
  170.  
  171.  
  172.  
  173. local bulletposition = release.Position
  174. local bulletvelocity = (Vector3.new(math.random(-7,7), math.random(-7,7), math.random(-7,7)))+( mouse.Hit.p - bulletposition).unit*150
  175. local bulletlastposition = bulletposition
  176. rayPart.CFrame = CFrame.new( bulletposition, bulletposition+bulletvelocity )
  177.  
  178.  
  179.  
  180.  
  181.  
  182. coroutine.resume(coroutine.create(function()
  183. while true do
  184. local dt = wait()
  185. bulletlastposition = bulletposition
  186. bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*10, 0)*dt)
  187. bulletposition = bulletposition + (bulletvelocity*dt)
  188. rayPart.Parent = workspace
  189.  
  190. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  191. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
  192.  
  193. if (torso.Position - rayPart.Position).magnitude > 440 then
  194. rayPart:Destroy()
  195. break
  196. end
  197.  
  198.  
  199. if hit then
  200. local damage = math.random(9999999, 99999999)
  201. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  202. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
  203. coroutine.wrap(function()
  204. local prt = Instance.new("Part", char)
  205. prt.FormFactor = "Custom"
  206. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  207. prt.Transparency = 1
  208. prt.CanCollide = false
  209. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  210. prt.Anchored = true
  211. coroutine.resume(coroutine.create(function()
  212. for i = 2, 10, 0.1 do
  213. if prt == nil then return end
  214. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  215. game:service'RunService'.Stepped:wait()
  216. end
  217. end))
  218.  
  219. local bg = Instance.new("BillboardGui")
  220. bg.Parent = prt
  221. bg.Adornee = prt
  222. bg.Size = UDim2.new(4, 0, 3.5, 0)
  223. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  224. local lol = Instance.new("TextLabel")
  225. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  226. lol.TextScaled = true
  227. lol.TextWrapped = true
  228. lol.BackgroundTransparency = 1
  229. lol.Parent = bg
  230. lol.FontSize = "Size24"
  231. lol.TextColor3 = Color3.new(1, 0, 0)
  232. lol.TextStrokeTransparency = 0
  233. lol.Font = "ArialBold"
  234. lol.Text = "-"..damage
  235.  
  236. wait(3)
  237. prt:Destroy()
  238. end)()
  239. end
  240. if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
  241. hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
  242. coroutine.wrap(function()
  243. local prt = Instance.new("Part", char)
  244. prt.FormFactor = "Custom"
  245. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  246. prt.Transparency = 1
  247. prt.CanCollide = false
  248. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  249. prt.Anchored = true
  250. coroutine.resume(coroutine.create(function()
  251. for i = 2, 10, 0.1 do
  252. if prt == nil then return end
  253. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  254. game:service'RunService'.Stepped:wait()
  255. end
  256. end))
  257.  
  258. local bg = Instance.new("BillboardGui")
  259. bg.Parent = prt
  260. bg.Adornee = prt
  261. bg.Size = UDim2.new(4, 0, 3.5, 0)
  262. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  263. local lol = Instance.new("TextLabel")
  264. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  265. lol.TextScaled = true
  266. lol.TextWrapped = true
  267. lol.BackgroundTransparency = 1
  268. lol.Parent = bg
  269. lol.FontSize = "Size24"
  270. lol.TextColor3 = Color3.new(1, 0, 0)
  271. lol.TextStrokeTransparency = 0
  272. lol.Font = "ArialBold"
  273. lol.Text = "-"..damage
  274.  
  275. wait(3)
  276. prt:Destroy()
  277. end)()
  278. end
  279. bulletposition = hitposition
  280. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  281. rayPart:Destroy()
  282. break
  283. end
  284. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  285. end
  286. end))
  287. end)()
  288. end
  289. wait(0.3)
  290. debounce = false
  291.  
  292. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement