Advertisement
metilol

Untitled

Apr 10th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 = 1
  18.  
  19.  
  20. local sound = Instance.new("Sound", head)
  21. sound.SoundId = "http://roblox.com/asset/?id=151414336"
  22. sound.Volume = 1
  23. local reloads = Instance.new("Sound", head)
  24. reloads.SoundId = "http://roblox.com/asset/?id=1529967756"
  25. reloads.Volume = 1
  26. local activate = Instance.new("Sound", head)
  27. activate.SoundId = "http://roblox.com/asset/?id=0"
  28. activate.Volume = 1
  29.  
  30.  
  31. local equipped = false
  32.  
  33. local debounce = false
  34.  
  35. local face = head.face
  36.  
  37. release = Instance.new("Part", nil)
  38. release.FormFactor = "Custom"
  39. release.Size = Vector3.new(0.3, 1.7, 0.3)
  40. release.Transparency = 1
  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.Transparency = 1
  53. release2.BrickColor = BrickColor.Black()
  54. release2.Locked = true
  55. local weld2 = Instance.new("Weld", release2)
  56. weld2.Part0 = release2
  57. weld2.Part1 = head
  58. weld2.C0 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
  59. local mesh2 = Instance.new("CylinderMesh", release2)
  60.  
  61. headext = Instance.new("Part", nil)
  62. headext.Position = torso.Position
  63. headext.FormFactor = "Custom"
  64. headext.Transparency = 1
  65. headext:BreakJoints()
  66. headext.Size = Vector3.new(2, 1, 1)
  67. headextw = Instance.new("Weld", headext)
  68. headextw.C0 = CFrame.new(Vector3.new(0, 1.5, 0))
  69. headextw.Part0 = torso
  70. headextw.Part1 = headext
  71. headextw.C1 = CFrame.new()
  72. headweld = Instance.new("Weld", headext)
  73. game:service("RunService").Stepped:connect(function()
  74. headweld.C0 = CFrame.new(Vector3.new(0,0,0), torso.CFrame:pointToObjectSpace(mouse.Hit.p)) * CFrame.Angles(0, 0, 0)
  75. end)
  76. headweld.Part0 = headext
  77. headweld.C1 = CFrame.new()
  78. headweld.Part1 = head
  79.  
  80. local Screen = Instance.new("ScreenGui", plr:findFirstChild("PlayerGui"))
  81. local TextBox = Instance.new("TextLabel", Screen)
  82. TextBox.Position = UDim2.new(0.1, 0, 0.95, 0)
  83. TextBox.Size = UDim2.new(0, 200, 0.05, 0)
  84. TextBox.BackgroundTransparency = 1
  85. game:service'RunService'.Stepped:connect(function()
  86. TextBox.Text = ("Ammo: "..ammo)
  87. end)
  88. TextBox.Font = "Cartoon"
  89. TextBox.TextColor3 = Color3.new(1, 1, 1)
  90. TextBox.FontSize = "Size36"
  91. TextBox.TextStrokeTransparency = 0
  92.  
  93. local pl = Instance.new("PointLight", release)
  94. pl.Range = 16
  95. pl.Brightness = 5
  96. pl.Color = Color3.new(1, 199/255, 67/255)
  97. pl.Enabled = false
  98. function reload()
  99. if ammo > 9 then return end
  100. reloads:play()
  101. ammo = ammo + 0
  102. activate:play()
  103. wait(0.3)
  104. debounce = false
  105. end
  106.  
  107. mouse.KeyDown:connect(function(key)
  108. if key == "r" then
  109. if debounce then return end
  110. if not equipped then return end
  111. if ammo > 9 then return end
  112. debounce = true
  113. reload()
  114. end
  115.  
  116. if key == "q" then
  117. equipped = not equipped
  118. if equipped then
  119. headext.Parent = char
  120. release.Parent = char
  121. release2.Parent = char
  122. face.Parent = nil
  123. for scale = 0, 1, 0.2 do
  124. weld2.C0 = CFrame.new(0, -scale + 0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
  125. weld.C0 = CFrame.new(0, -scale + 0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  126. mesh.Scale = Vector3.new(1, scale, 1)
  127. mesh2.Scale = Vector3.new(1, scale, 1)
  128. wait()
  129. end
  130. else
  131. face.Parent = head
  132. release.Parent = nil
  133. release2.Parent = nil
  134. headext.Parent = nil
  135. end
  136. end
  137. end)
  138.  
  139. mouse.Button1Down:connect(function()
  140. if not equipped then return end
  141. if ammo < 1 then return end
  142. if debounce then return end
  143. debounce = true
  144. sound:play()
  145. pl.Enabled = true
  146. ammo = ammo - 0
  147. coroutine.wrap(function()
  148. wait(0.07)
  149. pl.Enabled = false
  150. end)()
  151. coroutine.wrap(function()
  152. for scale = 0.7, 1, 0.1 do
  153. mesh.Scale = Vector3.new(1, scale, 1)
  154. wait()
  155. end
  156. end)()
  157.  
  158. local shell = Instance.new("Part", workspace)
  159. shell.BrickColor = BrickColor.Red()
  160. shell.FormFactor = "Custom"
  161. shell.Size = Vector3.new(0.3, 0.7, 0.3)
  162. shell.CFrame = head.CFrame * CFrame.new(0, 0.1, 0.5) * CFrame.Angles(math.pi/2, 0, math.pi/2)
  163. local bodyF = Instance.new("BodyVelocity", shell)
  164. bodyF.maxForce = Vector3.new(1e5, 0, 1e5)
  165. bodyF.P = 1e3
  166. bodyF.velocity = head.CFrame.lookVector * -20
  167. Instance.new("CylinderMesh", shell)
  168.  
  169. local shell2 = Instance.new("Part", shell)
  170. shell2.BrickColor = BrickColor.Red()
  171. shell2.FormFactor = "Custom"
  172. shell2.Size = Vector3.new(0.3, 0.2, 0.3)
  173. shell2:BreakJoints()
  174. local weld = Instance.new("Weld", shell2)
  175. weld.Part0 = shell2
  176. weld.Part1 = shell
  177. weld.C0 = CFrame.new(0, 0.45, 0)
  178. Instance.new("CylinderMesh", shell2)
  179. coroutine.wrap(function()
  180. wait(0.2)
  181. bodyF:Destroy()
  182. wait(4.8)
  183.  
  184. for _ = 0, 5 do
  185. shell.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
  186. shell.Transparency = shell.Transparency + 0.2
  187. shell2.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
  188. shell2.Transparency = shell.Transparency + 0.2
  189. wait()
  190. end
  191.  
  192. shell:Destroy()
  193. end)()
  194.  
  195. for bullet = 0, 5 do
  196. coroutine.wrap(function()
  197. if char.Humanoid.Health < 1 then return end
  198. local rayPart = Instance.new("Part")
  199. rayPart.Name = "RayPart"
  200. rayPart.BrickColor = BrickColor.Red()
  201. rayPart.Anchored = true
  202. rayPart.CanCollide = false
  203. rayPart.Locked = true
  204. rayPart.TopSurface = Enum.SurfaceType.Smooth
  205. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  206. rayPart.formFactor = Enum.FormFactor.Custom
  207. rayPart.Size = Vector3.new(0.2, 0.2, 4)
  208. Instance.new("BlockMesh", rayPart).Scale = Vector3.new(0.2, 0.2, 0.5)
  209.  
  210.  
  211.  
  212. local bulletposition = release.Position
  213. local bulletvelocity = (Vector3.new(math.random(-7,7), math.random(-7,7), math.random(-7,7)))+( mouse.Hit.p - bulletposition).unit*150
  214. local bulletlastposition = bulletposition
  215. rayPart.CFrame = CFrame.new( bulletposition, bulletposition+bulletvelocity )
  216.  
  217.  
  218.  
  219.  
  220.  
  221. coroutine.resume(coroutine.create(function()
  222. while true do
  223. local dt = wait()
  224. bulletlastposition = bulletposition
  225. bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*10, 0)*dt)
  226. bulletposition = bulletposition + (bulletvelocity*dt)
  227. rayPart.Parent = workspace
  228.  
  229. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  230. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
  231.  
  232. if (torso.Position - rayPart.Position).magnitude > 440 then
  233. rayPart:Destroy()
  234. break
  235. end
  236.  
  237.  
  238. if hit then
  239. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  240. hit.Parent:Remove()
  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 = "Punish!"
  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:Remove()
  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 = "Punish!"
  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