fire17774

Untitled

Dec 1st, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.63 KB | None | 0 0
  1. local plr = game:service'Players'.LocalPlayer
  2. local char = plr.Character
  3. local mouse = plr:GetMouse()
  4. local torso = char:findFirstChild("Torso")
  5. local head = char.Head
  6. local ra = char:findFirstChild("Right Arm")
  7. local la = char:findFirstChild("Left Arm")
  8. local rl = char:findFirstChild("Right Leg")
  9. local ll = char:findFirstChild("Left Leg")
  10. local rs = torso:findFirstChild("Right Shoulder")
  11. local ls = torso:findFirstChild("Left Shoulder")
  12. local neck = torso:findFirstChild("Neck")
  13.  
  14. local spread = -1
  15. local spread2 = 1
  16. local used = false
  17. local shootdebounce = false
  18. local sound = Instance.new("Sound", head)
  19. local ammo = 6
  20. sound.SoundId = "http://roblox.com/asset/?id=10209875"
  21. sound.Volume = 0.5
  22. local sound2 = Instance.new("Sound", head)
  23. sound2.SoundId = "http://roblox.com/asset/?id=10209590"
  24. sound2.Volume = 1
  25. local Screen = Instance.new("ScreenGui", plr:findFirstChild("PlayerGui"))
  26. local TextBox = Instance.new("TextLabel", Screen)
  27. TextBox.Position = UDim2.new(0.1, 0, 0.95, 0)
  28. TextBox.Size = UDim2.new(0, 200, 0.05, 0)
  29. TextBox.BackgroundTransparency = 1
  30. game:service'RunService'.Stepped:connect(function()
  31. TextBox.Text = ("Ammo: "..ammo)
  32. end)
  33. TextBox.Font = "SourceSansBold"
  34. TextBox.TextColor3 = Color3.new(1, 1, 1)
  35. TextBox.FontSize = "Size36"
  36. TextBox.TextStrokeTransparency = 0
  37. TextBox.BackgroundColor = BrickColor.new("Navy blue")
  38. pcall(function()
  39. char:findFirstChild("REVOLVER24/7"):Destroy()
  40. end)
  41. local main = Instance.new("Model", char)
  42. main.Name = "REVOLVER24/7"
  43. function part(parent, size, formfactor, color, collide, transparency)
  44. local p=Instance.new("Part", parent)
  45. p.FormFactor=formfactor
  46. p.CanCollide=false
  47. p.Size=size
  48. p.Locked=true
  49. p.Transparency=transparency
  50. p.Position=torso.Position
  51. p.BrickColor=color
  52. p.FrontSurface="SmoothNoOutlines"
  53. p.BackSurface="SmoothNoOutlines"
  54. p.LeftSurface="SmoothNoOutlines"
  55. p.BottomSurface="SmoothNoOutlines"
  56. p.TopSurface="SmoothNoOutlines"
  57. p.RightSurface="SmoothNoOutlines"
  58. return p
  59. end
  60. function wedge(parent, size, formfactor, color, collide)
  61. local p=Instance.new("Wedge", parent)
  62. p.FormFactor=formfactor
  63. p.CanCollide=false
  64. p.Size=size
  65. p.Locked=true
  66. p.Position = torso.Position
  67. p.BrickColor=color
  68. p.FrontSurface="SmoothNoOutlines"
  69. p.BackSurface="SmoothNoOutlines"
  70. p.LeftSurface="SmoothNoOutlines"
  71. p.BottomSurface="SmoothNoOutlines"
  72. p.TopSurface="SmoothNoOutlines"
  73. p.RightSurface="SmoothNoOutlines"
  74. return p
  75. end
  76. function weld(c0, c1, part1, part0)
  77. local wel=Instance.new("Weld", main)
  78. wel.Part0 = part0
  79. wel.Part1 = part1
  80. wel.C0 = c0
  81. wel.C1 = c1
  82. return wel
  83. end
  84. function specialmesh(parent, meshType, scale, meshId, texture)
  85. local mesh = Instance.new("SpecialMesh", parent)
  86. mesh.Scale = scale
  87. mesh.MeshType = meshType
  88. mesh.MeshId = meshId
  89. mesh.TextureId = texture
  90. return mesh
  91. end
  92.  
  93.  
  94. local p = part(main, Vector3.new(0.3, 0.9, 0.3), "Custom", BrickColor.Black(), false, 0)
  95. local w = weld(CFrame.new(0, -.2, 0.9) * CFrame.Angles(math.rad(105), 0, 0), CFrame.new(), ra, p)
  96. local p1 = part(main, Vector3.new(0.3, 0.5, 0.3), "Custom", BrickColor.Black(), false, 0)
  97. local w1 = weld(CFrame.new(0, -.4, -.1) * CFrame.Angles(math.rad(30), 0, 0), CFrame.new(), p, p1)
  98. local p2 = part(main, Vector3.new(0.2, 1, 0.4), "Custom", BrickColor.Gray(), false, 0)
  99. local w2 = weld(CFrame.new(0, -.2, 0.9) * CFrame.Angles(math.rad(105), 0, 0), CFrame.new(), ra, p2)
  100. local p3 = part(main, Vector3.new(0.2, 0.6, 0.4), "Custom", BrickColor.Gray(), false, 0)
  101. local w3 = weld(CFrame.new(0, -.4, -.1) * CFrame.Angles(math.rad(30), 0, 0), CFrame.new(), p2, p3)
  102. local p4 = part(main, Vector3.new(0.205, 1.2, 0.3), "Custom", BrickColor.Gray(), false, 0)
  103. local w4 = weld(CFrame.new(0, 1.65, 0.55), CFrame.new(), ra, p4)
  104. local p5 = part(main, Vector3.new(0.2, 1.2, 0.2), "Custom", BrickColor.Gray(), false, 0)
  105. local w5 = weld(CFrame.new(0, 0.05, 0.1), CFrame.new(), p4, p5)
  106. local p6 = part(main, Vector3.new(0.2, 1.2, 0.2), "Custom", BrickColor.Black(), false, 0)
  107. Instance.new("CylinderMesh", p6).Scale = Vector3.new(0.5, 1, 0.5)
  108. local w6 = weld(CFrame.new(0, 0.002, 0.02), CFrame.new(), p5, p6)
  109. local p7 = part(main, Vector3.new(0.34, 0.37, 0.34), "Custom", BrickColor.Gray(), false, 0)
  110. local p7mesh = Instance.new("CylinderMesh", p7)
  111. local w7 = weld(CFrame.new(0, 0, 0), CFrame.new(), p6, p7)
  112. local p8 = part(main, Vector3.new(0.2, 1.2, 0.2), "Custom", BrickColor.Gray(), false, 0)
  113. local p8mesh = Instance.new("CylinderMesh", p8)
  114. local w8 = weld(CFrame.new(0, -0.01, 0.05), CFrame.new(), p6, p8)
  115.  
  116.  
  117. function equip()
  118. ar = Instance.new("Part", main)
  119. ar.FormFactor = "Custom"
  120. ar.Size = Vector3.new(1, 1, 1)
  121. ar.Transparency = 1
  122. ar.CanCollide = false
  123. ar.Locked = true
  124. ar:breakJoints()
  125.  
  126.  
  127. fakel = Instance.new("Weld", main)
  128. fakel.Part0 = char.Torso
  129. fakel.Part1 = ar
  130. fakel.C0 = CFrame.new(1.5, 0.5, 0)
  131. welditbro = Instance.new("Weld", main)
  132. welditbro.C0 = CFrame.new(0, 0.5, 0)
  133. welditbro.Part0 = ra
  134. welditbro.Part1 = ar
  135.  
  136. coroutine.wrap(function()
  137. for angle = 0, 70, 10 do
  138. neck.C0 = neck.C0 * CFrame.Angles(0, 0, -math.rad(10))
  139. wait()
  140. end
  141. end)()
  142. coroutine.wrap(function()
  143. for i = 0, 90, 10 do
  144. fakel.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(i), 0, math.rad(i))
  145. wait()
  146. end
  147. end)()
  148.  
  149. bg2 = Instance.new("BodyGyro", torso)
  150. bg2.P = 9999
  151. bg2.D = 2000
  152. bg2.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  153.  
  154. for i = 0, 90, 10 do
  155. bg2.cframe = CFrame.new(torso.Position,Vector3.new(mouse.hit.p.x,torso.Position.y,mouse.hit.p.z)) * CFrame.Angles(0, math.rad(i), 0)
  156. wait()
  157. end
  158. coroutine.wrap(function()
  159. while used do
  160. bg2.cframe = CFrame.new(torso.Position,Vector3.new(mouse.hit.p.x,torso.Position.y,mouse.hit.p.z)) * CFrame.Angles(0, math.rad(90), 0)
  161. game:service'RunService'.Stepped:wait()
  162. end
  163. end)()
  164. debounce = false
  165. end
  166.  
  167.  
  168. function reload()
  169. if not used then return end
  170. local ar2 = Instance.new("Part", main)
  171. ar2.FormFactor = "Custom"
  172. ar2.Size = Vector3.new(1, 1, 1)
  173. ar2.Transparency = 1
  174. ar2.CanCollide = false
  175. ar2.Locked = true
  176. ar2:breakJoints()
  177.  
  178.  
  179. local fakel2 = Instance.new("Weld", main)
  180. fakel2.Part0 = char.Torso
  181. fakel2.Part1 = ar2
  182. fakel2.C0 = CFrame.new(-1.5, 0.5, 0)
  183. local welditbro2 = Instance.new("Weld", main)
  184. welditbro2.C0 = CFrame.new(0, 0.5, 0)
  185. welditbro2.Part0 = la
  186. welditbro2.Part1 = ar2
  187.  
  188. coroutine.wrap(function()
  189. for angle = 0, 70, 10 do
  190. neck.C0 = neck.C0 * CFrame.Angles(0, 0, math.rad(10))
  191. wait()
  192. end
  193. for angle = 0, 70, 10 do
  194. neck.C0 = neck.C0 * CFrame.Angles(math.rad(5), 0, 0)
  195. wait()
  196. end
  197. end)()
  198. coroutine.wrap(function()
  199. for angle = 90, -60, -10 do
  200. fakel.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(angle + 80), 0, math.rad(angle))
  201. wait()
  202. end
  203. end)()
  204. for angle = 0, 60, 10 do
  205. fakel2.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(angle), 0, math.rad(angle))
  206. wait()
  207. end
  208. wait(2)
  209. ammo = 6
  210. coroutine.wrap(function()
  211. for angle = -60, 90, 10 do
  212. fakel.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(angle + 80), 0, math.rad(angle))
  213. wait()
  214. end
  215. fakel.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(90))
  216. end)()
  217. coroutine.wrap(function()
  218. for angle = 0, 70, 10 do
  219. neck.C0 = neck.C0 * CFrame.Angles(-math.rad(5), 0, 0)
  220. wait()
  221. end
  222. for angle = 0, 70, 10 do
  223. neck.C0 = neck.C0 * CFrame.Angles(0, 0,-math.rad(10))
  224. wait()
  225. end
  226. end)()
  227. for angle = 60, 0, -10 do
  228. fakel2.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(angle), 0, math.rad(angle))
  229. wait()
  230. end
  231. pcall(function()
  232. ar2:Destroy()
  233. fakel2:Destory()
  234. welditbro2:Destroy()
  235. end)
  236. shootdebounce = false
  237.  
  238. end
  239. function unequip()
  240. coroutine.wrap(function()
  241. for angle = 0, 70, 10 do
  242. neck.C0 = neck.C0 * CFrame.Angles(0, 0, math.rad(10))
  243. wait()
  244. end
  245. end)()
  246. coroutine.wrap(function()
  247. for i = 90, 0, -10 do
  248. fakel.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(i), 0, math.rad(i))
  249. wait()
  250. end
  251. end)()
  252. for i = 90, 0, -10 do
  253. bg2.cframe = CFrame.new(torso.Position,Vector3.new(mouse.hit.p.x,torso.Position.y,mouse.hit.p.z)) * CFrame.Angles(0, math.rad(i), 0)
  254. wait()
  255. end
  256. pcall(function()
  257. bg2:Destroy()
  258. fakel:Destroy()
  259. welditbro:Destroy()
  260. ar:Destroy()
  261. end)
  262. end
  263.  
  264.  
  265. mouse.KeyDown:connect(function(key)
  266. if key == "q" then
  267. if shootdebounce then return end
  268. if debounce then return end
  269. used = not used
  270. if used then
  271. debounce = true
  272. equip()
  273. else
  274. debounce = true
  275. used = false
  276. unequip()
  277. debounce = false
  278. end
  279.  
  280. end
  281. if key == "r" then
  282. if shootdebounce then return end
  283. if debounce then return end
  284. if not used then return end
  285. shootdebounce = true
  286. reload()
  287. end
  288. end)
  289.  
  290.  
  291. mouse.Button1Down:connect(function(mouse)
  292. if not used then return end
  293. if shootdebounce then return end
  294. if ammo < 1 then sound2:play() return end
  295. if debounce then return end
  296. shootdebounce = true
  297. coroutine.wrap(function()
  298. sound:play()
  299.  
  300. ammo = ammo - 1
  301. local muz = part(main, Vector3.new(0.8, 1.2, 0.8), "Custom", BrickColor.Yellow(), false, 0)
  302. muz.Transparency = 0.2
  303. specialmesh(muz, "Sphere", Vector3.new(1, 1, 1), "", "")
  304. local localweld = weld(CFrame.new(0, 1.2, 0), CFrame.new(), p5, muz)
  305. local muzflash = Instance.new("PointLight", muz)
  306. muzflash.Color = Color3.new(1, 1, 0)
  307. muzflash.Range = 19
  308.  
  309. pcall(function()
  310. local ray = Ray.new(muz.CFrame.p, ((plr:GetMouse().Hit.p + Vector3.new(math.random(spread,spread2), math.random(spread,spread2), math.random(spread,spread2))/4) - muz.CFrame.p).unit*1000)
  311. local hit, position = game.Workspace:FindPartOnRay(ray, char)
  312.  
  313.  
  314. --do damage to any humanoids hit
  315. pcall(function()
  316.  
  317. if hit.Parent:IsA("Hat") then
  318. hit.Parent.Parent:findFirstChild("Humanoid"):TakeDamage(30)
  319. end
  320. if hit:IsA("Part") and hit.Name == "Head" then
  321. hit.Parent:findFirstChild("Humanoid"):TakeDamage(50)
  322. end
  323.  
  324. if hit:IsA("Part") and hit.Name == "Torso" then
  325. coroutine.wrap(function()
  326. local restored = hit.Parent:findFirstChild("Humanoid").WalkSpeed
  327. hit.Parent:findFirstChild("Humanoid"):TakeDamage(30)
  328. hit.Parent:findFirstChild("Humanoid").PlatformStand = true
  329. wait(1)
  330. hit.Parent:findFirstChild("Humanoid").WalkSpeed = 4
  331. hit.Parent:findFirstChild("Humanoid").PlatformStand = false
  332. wait(8)
  333. hit.Parent:findFirstChild("Humanoid").WalkSpeed = restored
  334. end)()
  335. end
  336.  
  337. if hit:IsA("Part") and hit.Name == "Left Leg" or hit.Name == "Right Leg" then
  338. hit.Parent:findFirstChild("Humanoid"):TakeDamage(10)
  339. hit.Parent:findFirstChild("Humanoid").WalkSpeed = hit.Parent:findFirstChild("Humanoid").WalkSpeed - 1
  340. end
  341. if hit:IsA("Part") and hit.Name == "Left Arm" or hit.Name == "Right Arm" then
  342. hit.Parent:findFirstChild("Humanoid"):TakeDamage(10)
  343. hit.Parent:findFirstChild("Humanoid").WalkSpeed = hit.Parent:findFirstChild("Humanoid").WalkSpeed - 0.2
  344. end
  345. end)
  346.  
  347. --draw the ray
  348.  
  349. local distance = (position - muz.CFrame.p).magnitude
  350. local rayPart = Instance.new("Part", char)
  351. rayPart.Name = "RayPart"
  352. rayPart.BrickColor = BrickColor.new("White")
  353. rayPart.Transparency = 0
  354. rayPart.Anchored = true
  355. rayPart.CanCollide = false
  356.  
  357. rayPart.TopSurface = Enum.SurfaceType.Smooth
  358. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  359. rayPart.formFactor = Enum.FormFactor.Custom
  360. rayPart.Size = Vector3.new(0.2, distance, 0.2)
  361. Instance.new("CylinderMesh", rayPart)
  362. rayPart.CFrame = CFrame.new(position, muz.CFrame.p) * CFrame.new(0, 0, -distance/2) * CFrame.Angles(math.pi/2, 0, 0)
  363.  
  364.  
  365. coroutine.wrap(function()
  366. for i = 0, 30 do
  367. if rayPart == nil then return end
  368. rayPart.Transparency = rayPart.Transparency + 0.1
  369. if muz == nil then return end
  370. muz.Transparency = muz.Transparency + 0.2
  371. wait()
  372. end
  373. end)()
  374. end)
  375. wait(0.05)
  376. muz:Destroy()
  377. localweld:Destroy()
  378. game:service'Debris':AddItem(rayPart, 0)
  379. end)()
  380. for i = 0, 30, 15 do
  381. fakel.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(i), math.rad(90))
  382. wait()
  383. end
  384. wait()
  385. for i = 30, 0, -10 do
  386. fakel.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(i), math.rad(90))
  387. wait()
  388. end
  389. shootdebounce = false
  390.  
  391. end)
Advertisement
Add Comment
Please, Sign In to add comment