Advertisement
BabyGoatz

Untitled

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