Advertisement
Dark_EccentricYT

Untitled

Nov 28th, 2016
2,812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.20 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 = 8
  18.  
  19.  
  20. local sound = Instance.new("Sound", head)
  21. sound.SoundId = "http://roblox.com/asset/?id=10209842"
  22. sound.Volume = 1
  23. local reloads = Instance.new("Sound", head)
  24. reloads.SoundId = "http://roblox.com/asset/?id=10209636"
  25. reloads.Volume = 1
  26. local activate = Instance.new("Sound", head)
  27. activate.SoundId = "http://roblox.com/asset/?id=10209894"
  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.3, 1.7, 0.3)
  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.2, 1.4, 0.2)
  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. face.Parent = nil
  122. for scale = 0, 1, 0.2 do
  123. weld2.C0 = CFrame.new(0, -scale + 0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
  124. weld.C0 = CFrame.new(0, -scale + 0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  125. mesh.Scale = Vector3.new(1, scale, 1)
  126. mesh2.Scale = Vector3.new(1, scale, 1)
  127. wait()
  128. end
  129. else
  130. face.Parent = head
  131. release.Parent = nil
  132. release2.Parent = nil
  133. headext.Parent = nil
  134. end
  135. end
  136. end)
  137.  
  138. mouse.Button1Down:connect(function()
  139. if not equipped then return end
  140. if ammo < 1 then return end
  141. if debounce then return end
  142. debounce = true
  143. sound:play()
  144. pl.Enabled = true
  145. ammo = ammo - 1
  146. coroutine.wrap(function()
  147. wait(0.07)
  148. pl.Enabled = false
  149. end)()
  150. coroutine.wrap(function()
  151. for scale = 0.7, 1, 0.1 do
  152. mesh.Scale = Vector3.new(1, scale, 1)
  153. wait()
  154. end
  155. end)()
  156.  
  157. local shell = Instance.new("Part", workspace)
  158. shell.BrickColor = BrickColor.Red()
  159. shell.FormFactor = "Custom"
  160. shell.Size = Vector3.new(0.3, 0.7, 0.3)
  161. shell.CFrame = head.CFrame * CFrame.new(0, 0.1, 0.5) * CFrame.Angles(math.pi/2, 0, math.pi/2)
  162. local bodyF = Instance.new("BodyVelocity", shell)
  163. bodyF.maxForce = Vector3.new(1e5, 0, 1e5)
  164. bodyF.P = 1e3
  165. bodyF.velocity = head.CFrame.lookVector * -20
  166. Instance.new("CylinderMesh", shell)
  167.  
  168. local shell2 = Instance.new("Part", shell)
  169. shell2.BrickColor = BrickColor.Yellow()
  170. shell2.FormFactor = "Custom"
  171. shell2.Size = Vector3.new(0.3, 0.2, 0.3)
  172. shell2:BreakJoints()
  173. local weld = Instance.new("Weld", shell2)
  174. weld.Part0 = shell2
  175. weld.Part1 = shell
  176. weld.C0 = CFrame.new(0, 0.45, 0)
  177. Instance.new("CylinderMesh", shell2)
  178. coroutine.wrap(function()
  179. wait(0.2)
  180. bodyF:Destroy()
  181. wait(4.8)
  182.  
  183. for _ = 0, 5 do
  184. shell.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
  185. shell.Transparency = shell.Transparency + 0.2
  186. shell2.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
  187. shell2.Transparency = shell.Transparency + 0.2
  188. wait()
  189. end
  190.  
  191. shell:Destroy()
  192. end)()
  193.  
  194. for bullet = 0, 5 do
  195. coroutine.wrap(function()
  196. if char.Humanoid.Health < 1 then return end
  197. local rayPart = Instance.new("Part")
  198. rayPart.Name = "RayPart"
  199. rayPart.BrickColor = BrickColor.Yellow()
  200. rayPart.Anchored = true
  201. rayPart.CanCollide = false
  202. rayPart.Locked = true
  203. rayPart.TopSurface = Enum.SurfaceType.Smooth
  204. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  205. rayPart.formFactor = Enum.FormFactor.Custom
  206. rayPart.Size = Vector3.new(0.2, 0.2, 4)
  207. Instance.new("BlockMesh", rayPart).Scale = Vector3.new(0.2, 0.2, 0.5)
  208.  
  209.  
  210.  
  211. local bulletposition = release.Position
  212. local bulletvelocity = (Vector3.new(math.random(-7,7), math.random(-7,7), math.random(-7,7)))+( mouse.Hit.p - bulletposition).unit*150
  213. local bulletlastposition = bulletposition
  214. rayPart.CFrame = CFrame.new( bulletposition, bulletposition+bulletvelocity )
  215.  
  216.  
  217.  
  218.  
  219.  
  220. coroutine.resume(coroutine.create(function()
  221. while true do
  222. local dt = wait()
  223. bulletlastposition = bulletposition
  224. bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*10, 0)*dt)
  225. bulletposition = bulletposition + (bulletvelocity*dt)
  226. rayPart.Parent = workspace
  227.  
  228. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  229. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
  230.  
  231. if (torso.Position - rayPart.Position).magnitude > 440 then
  232. rayPart:Destroy()
  233. break
  234. end
  235.  
  236.  
  237. if hit then
  238. local damage = math.random(6, 11)
  239. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  240. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
  241. coroutine.wrap(function()
  242. local prt = Instance.new("Part", char)
  243. prt.FormFactor = "Custom"
  244. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  245. prt.Transparency = 1
  246. prt.CanCollide = false
  247. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  248. prt.Anchored = true
  249. coroutine.resume(coroutine.create(function()
  250. for i = 2, 10, 0.1 do
  251. if prt == nil then return end
  252. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  253. game:service'RunService'.Stepped:wait()
  254. end
  255. end))
  256.  
  257. local bg = Instance.new("BillboardGui")
  258. bg.Parent = prt
  259. bg.Adornee = prt
  260. bg.Size = UDim2.new(4, 0, 3.5, 0)
  261. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  262. local lol = Instance.new("TextLabel")
  263. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  264. lol.TextScaled = true
  265. lol.TextWrapped = true
  266. lol.BackgroundTransparency = 1
  267. lol.Parent = bg
  268. lol.FontSize = "Size24"
  269. lol.TextColor3 = Color3.new(1, 0, 0)
  270. lol.TextStrokeTransparency = 0
  271. lol.Font = "ArialBold"
  272. lol.Text = "-"..damage
  273.  
  274. wait(3)
  275. prt:Destroy()
  276. end)()
  277. end
  278. if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
  279. hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
  280. coroutine.wrap(function()
  281. local prt = Instance.new("Part", char)
  282. prt.FormFactor = "Custom"
  283. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  284. prt.Transparency = 1
  285. prt.CanCollide = false
  286. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  287. prt.Anchored = true
  288. coroutine.resume(coroutine.create(function()
  289. for i = 2, 10, 0.1 do
  290. if prt == nil then return end
  291. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  292. game:service'RunService'.Stepped:wait()
  293. end
  294. end))
  295.  
  296. local bg = Instance.new("BillboardGui")
  297. bg.Parent = prt
  298. bg.Adornee = prt
  299. bg.Size = UDim2.new(4, 0, 3.5, 0)
  300. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  301. local lol = Instance.new("TextLabel")
  302. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  303. lol.TextScaled = true
  304. lol.TextWrapped = true
  305. lol.BackgroundTransparency = 1
  306. lol.Parent = bg
  307. lol.FontSize = "Size24"
  308. lol.TextColor3 = Color3.new(1, 0, 0)
  309. lol.TextStrokeTransparency = 0
  310. lol.Font = "ArialBold"
  311. lol.Text = "-"..damage
  312.  
  313. wait(3)
  314. prt:Destroy()
  315. end)()
  316. end
  317. bulletposition = hitposition
  318. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  319. rayPart:Destroy()
  320. break
  321. end
  322. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  323. end
  324. end))
  325. end)()
  326. end
  327. wait(0.3)
  328. debounce = false
  329.  
  330. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement