Advertisement
tyridge77

Gun

Aug 13th, 2015
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.89 KB | None | 0 0
  1. local Scale = game.Players.LocalPlayer.Character.Torso.Size.Y/2
  2. local Speed = 10*Scale
  3. local Gravity = 0.1
  4.  
  5. local Player = game.Players.LocalPlayer
  6. local Mouse = Player:GetMouse();
  7. pit = 16;
  8. Player.Chatted:connect(function(msg)
  9.    if tonumber(msg) then
  10.    pit = tonumber(msg)
  11.    
  12.    end
  13. end)
  14. Mouse.KeyDown:connect(function(k)
  15.   if k == "v" then
  16.      s = Instance.new("Sound",Player.Character.Torso);
  17.      s.SoundId = "rbxassetid://143302576";
  18.      s.Pitch = pit;
  19.      wait();
  20.      s.Volume = 1;
  21.      s:Play();
  22.   end
  23. end)
  24. local Character = Player.Character
  25. local Humanoid = Character.Humanoid
  26. local Torso = Character.HumanoidRootPart
  27. local Mouse = game.Players.LocalPlayer:GetMouse()
  28. local RenderStepped = game:GetService("RunService").RenderStepped
  29. local Camera = Workspace.CurrentCamera
  30. Camera:ClearAllChildren()
  31. local Model = Instance.new("Model",Character)
  32. local IgnoreList = {Character,Workspace.Terrain}
  33.  
  34. local Part0Joint = CFrame.new(Torso.Size.X/2,Torso.Size.Y*(0.75/2),0)
  35. local Part1Joint = CFrame.new(-Character["Right Arm"].Size.X/2,(0.75/2)*Character["Right Arm"].Size.Y,0)
  36. local RotationOffset = CFrame.Angles(math.rad(90),math.rad(0),0)
  37. local Gangster = false
  38.  
  39. local Part0JointHead = CFrame.new(0,Torso.Size.Y/2,0)
  40. local Part1JointHead = CFrame.new(0,-Character.Head.Size.Y/2,0)
  41. local RotationOffsetHead = CFrame.Angles(0,0,0)
  42.  
  43. local Handle = Instance.new("Part",Model)
  44. Handle.CanCollide = false
  45. Handle.Name = "Handle"
  46. Handle.Position = Vector3.new(0,100,0)
  47. Handle:BreakJoints()
  48. Handle.FormFactor = "Custom"
  49. Handle.Size = Vector3.new(0.2,0.2,0.2)
  50. Handle.TopSurface = "SmoothNoOutlines"
  51. Handle.BottomSurface = "SmoothNoOutlines"
  52. Handle.FrontSurface = "SmoothNoOutlines"
  53. Handle.BackSurface = "SmoothNoOutlines"
  54. Handle.RightSurface = "SmoothNoOutlines"
  55. Handle.LeftSurface = "SmoothNoOutlines"
  56. Handle.BrickColor = BrickColor.new("Black")
  57. local Mesh = Instance.new("BlockMesh",Handle)
  58. Mesh.Scale = Vector3.new(0.25,1,0.4) / 0.2 * Scale
  59. local HandleWeld = Instance.new("Motor6D")
  60. HandleWeld.Part0 = Character["Right Arm"]
  61. HandleWeld.Part1 = Handle
  62. HandleWeld.C0 = CFrame.new(Vector3.new(0,-Character["Right Arm"].Size.Y/2,0)) * CFrame.Angles(math.rad(-105),0,0)
  63. HandleWeld.Parent = Handle
  64.  
  65. local Part = Instance.new("Part",Model)
  66. Part.CanCollide = false
  67. Part.Position = Vector3.new(0,100,0)
  68. Part:BreakJoints()
  69. Part.FormFactor = "Custom"
  70. Part.Size = Vector3.new(0.2,0.2,0.2)
  71. Part.TopSurface = "SmoothNoOutlines"
  72. Part.BottomSurface = "SmoothNoOutlines"
  73. Part.FrontSurface = "SmoothNoOutlines"
  74. Part.BackSurface = "SmoothNoOutlines"
  75. Part.RightSurface = "SmoothNoOutlines"
  76. Part.LeftSurface = "SmoothNoOutlines"
  77. Part.BrickColor = BrickColor.new("Black")
  78. local Mesh = Instance.new("CylinderMesh",Part)
  79. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  80. local PartWeld = Instance.new("Motor6D")
  81. PartWeld.Part0 = Handle
  82. PartWeld.Part1 = Part
  83. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  84. PartWeld.Parent = Part
  85.  
  86. local Part = Instance.new("Part",Model)
  87. Part.CanCollide = false
  88. Part.Position = Vector3.new(0,100,0)
  89. Part:BreakJoints()
  90. Part.FormFactor = "Custom"
  91. Part.Size = Vector3.new(0.2,0.2,0.2)
  92. Part.TopSurface = "SmoothNoOutlines"
  93. Part.BottomSurface = "SmoothNoOutlines"
  94. Part.FrontSurface = "SmoothNoOutlines"
  95. Part.BackSurface = "SmoothNoOutlines"
  96. Part.RightSurface = "SmoothNoOutlines"
  97. Part.LeftSurface = "SmoothNoOutlines"
  98. Part.BrickColor = BrickColor.new("Black")
  99. local Mesh = Instance.new("CylinderMesh",Part)
  100. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  101. local PartWeld = Instance.new("Motor6D")
  102. PartWeld.Part0 = Handle
  103. PartWeld.Part1 = Part
  104. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  105. PartWeld.Parent = Part
  106.  
  107. local Part = Instance.new("Part",Model)
  108. Part.CanCollide = false
  109. Part.Position = Vector3.new(0,100,0)
  110. Part:BreakJoints()
  111. Part.FormFactor = "Custom"
  112. Part.Size = Vector3.new(0.2,0.2,0.2)
  113. Part.TopSurface = "SmoothNoOutlines"
  114. Part.BottomSurface = "SmoothNoOutlines"
  115. Part.FrontSurface = "SmoothNoOutlines"
  116. Part.BackSurface = "SmoothNoOutlines"
  117. Part.RightSurface = "SmoothNoOutlines"
  118. Part.LeftSurface = "SmoothNoOutlines"
  119. Part.BrickColor = BrickColor.new("Black")
  120. local Mesh = Instance.new("CylinderMesh",Part)
  121. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  122. local PartWeld = Instance.new("Motor6D")
  123. PartWeld.Part0 = Handle
  124. PartWeld.Part1 = Part
  125. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  126. PartWeld.Parent = Part
  127.  
  128. local Part = Instance.new("Part",Model)
  129. Part.CanCollide = false
  130. Part.Position = Vector3.new(0,100,0)
  131. Part:BreakJoints()
  132. Part.FormFactor = "Custom"
  133. Part.Size = Vector3.new(0.2,0.2,0.2)
  134. Part.TopSurface = "SmoothNoOutlines"
  135. Part.BottomSurface = "SmoothNoOutlines"
  136. Part.FrontSurface = "SmoothNoOutlines"
  137. Part.BackSurface = "SmoothNoOutlines"
  138. Part.RightSurface = "SmoothNoOutlines"
  139. Part.LeftSurface = "SmoothNoOutlines"
  140. Part.BrickColor = BrickColor.new("Black")
  141. local Mesh = Instance.new("CylinderMesh",Part)
  142. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  143. local PartWeld = Instance.new("Motor6D")
  144. PartWeld.Part0 = Handle
  145. PartWeld.Part1 = Part
  146. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  147. PartWeld.Parent = Part
  148.  
  149. local Part = Instance.new("Part",Model)
  150. Part.CanCollide = false
  151. Part.Position = Vector3.new(0,100,0)
  152. Part:BreakJoints()
  153. Part.FormFactor = "Custom"
  154. Part.Size = Vector3.new(0.2,0.2,0.2)
  155. Part.TopSurface = "SmoothNoOutlines"
  156. Part.BottomSurface = "SmoothNoOutlines"
  157. Part.FrontSurface = "SmoothNoOutlines"
  158. Part.BackSurface = "SmoothNoOutlines"
  159. Part.RightSurface = "SmoothNoOutlines"
  160. Part.LeftSurface = "SmoothNoOutlines"
  161. Part.BrickColor = BrickColor.new("Black")
  162. local Mesh = Instance.new("BlockMesh",Part)
  163. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  164. local PartWeld = Instance.new("Motor6D")
  165. PartWeld.Part0 = Handle
  166. PartWeld.Part1 = Part
  167. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,-0.175)*Scale) * CFrame.Angles(0,0,0)
  168. PartWeld.Parent = Part
  169.  
  170. local Part = Instance.new("Part",Model)
  171. Part.CanCollide = false
  172. Part.Position = Vector3.new(0,100,0)
  173. Part:BreakJoints()
  174. Part.FormFactor = "Custom"
  175. Part.Size = Vector3.new(0.2,0.2,0.2)
  176. Part.TopSurface = "SmoothNoOutlines"
  177. Part.BottomSurface = "SmoothNoOutlines"
  178. Part.FrontSurface = "SmoothNoOutlines"
  179. Part.BackSurface = "SmoothNoOutlines"
  180. Part.RightSurface = "SmoothNoOutlines"
  181. Part.LeftSurface = "SmoothNoOutlines"
  182. Part.BrickColor = BrickColor.new("Black")
  183. local Mesh = Instance.new("BlockMesh",Part)
  184. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  185. local PartWeld = Instance.new("Motor6D")
  186. PartWeld.Part0 = Handle
  187. PartWeld.Part1 = Part
  188. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,0.175)*Scale) * CFrame.Angles(0,0,0)
  189. PartWeld.Parent = Part
  190.  
  191. local Part = Instance.new("Part",Model)
  192. Part.CanCollide = false
  193. Part.Position = Vector3.new(0,100,0)
  194. Part:BreakJoints()
  195. Part.FormFactor = "Custom"
  196. Part.Size = Vector3.new(0.2,0.2,0.2)
  197. Part.TopSurface = "SmoothNoOutlines"
  198. Part.BottomSurface = "SmoothNoOutlines"
  199. Part.FrontSurface = "SmoothNoOutlines"
  200. Part.BackSurface = "SmoothNoOutlines"
  201. Part.RightSurface = "SmoothNoOutlines"
  202. Part.LeftSurface = "SmoothNoOutlines"
  203. Part.BrickColor = BrickColor.new("Black")
  204. local Mesh = Instance.new("BlockMesh",Part)
  205. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  206. local PartWeld = Instance.new("Motor6D")
  207. PartWeld.Part0 = Handle
  208. PartWeld.Part1 = Part
  209. PartWeld.C0 = CFrame.new(Vector3.new(-0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  210. PartWeld.Parent = Part
  211.  
  212. local Part = Instance.new("Part",Model)
  213. Part.CanCollide = false
  214. Part.Position = Vector3.new(0,100,0)
  215. Part:BreakJoints()
  216. Part.FormFactor = "Custom"
  217. Part.Size = Vector3.new(0.2,0.2,0.2)
  218. Part.TopSurface = "SmoothNoOutlines"
  219. Part.BottomSurface = "SmoothNoOutlines"
  220. Part.FrontSurface = "SmoothNoOutlines"
  221. Part.BackSurface = "SmoothNoOutlines"
  222. Part.RightSurface = "SmoothNoOutlines"
  223. Part.LeftSurface = "SmoothNoOutlines"
  224. Part.BrickColor = BrickColor.new("Black")
  225. local Mesh = Instance.new("BlockMesh",Part)
  226. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  227. local PartWeld = Instance.new("Motor6D")
  228. PartWeld.Part0 = Handle
  229. PartWeld.Part1 = Part
  230. PartWeld.C0 = CFrame.new(Vector3.new(0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  231. PartWeld.Parent = Part
  232.  
  233. local Part = Instance.new("Part",Model)
  234. Part.CanCollide = false
  235. Part.Position = Vector3.new(0,100,0)
  236. Part:BreakJoints()
  237. Part.FormFactor = "Custom"
  238. Part.Size = Vector3.new(0.2,0.2,0.2)
  239. Part.TopSurface = "SmoothNoOutlines"
  240. Part.BottomSurface = "SmoothNoOutlines"
  241. Part.FrontSurface = "SmoothNoOutlines"
  242. Part.BackSurface = "SmoothNoOutlines"
  243. Part.RightSurface = "SmoothNoOutlines"
  244. Part.LeftSurface = "SmoothNoOutlines"
  245. Part.BrickColor = BrickColor.new("Black")
  246. local Mesh = Instance.new("BlockMesh",Part)
  247. Mesh.Scale = Vector3.new(0.1,0.3,0.05) / 0.2 * Scale
  248. local PartWeld = Instance.new("Motor6D")
  249. PartWeld.Part0 = Handle
  250. PartWeld.Part1 = Part
  251. PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.25,-0.75)*Scale) * CFrame.Angles(math.rad(-10),0,0)
  252. PartWeld.Parent = Part
  253.  
  254. local Part = Instance.new("Part",Model)
  255. Part.CanCollide = false
  256. Part.Position = Vector3.new(0,100,0)
  257. Part:BreakJoints()
  258. Part.FormFactor = "Custom"
  259. Part.Size = Vector3.new(0.2,0.2,0.2)
  260. Part.TopSurface = "SmoothNoOutlines"
  261. Part.BottomSurface = "SmoothNoOutlines"
  262. Part.FrontSurface = "SmoothNoOutlines"
  263. Part.BackSurface = "SmoothNoOutlines"
  264. Part.RightSurface = "SmoothNoOutlines"
  265. Part.LeftSurface = "SmoothNoOutlines"
  266. Part.BrickColor = BrickColor.new("Black")
  267. local Mesh = Instance.new("BlockMesh",Part)
  268. Mesh.Scale = Vector3.new(0.1,0.05,0.625) / 0.2 * Scale
  269. local PartWeld = Instance.new("Motor6D")
  270. PartWeld.Part0 = Handle
  271. PartWeld.Part1 = Part
  272. PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.1,-0.435)*Scale)
  273. PartWeld.Parent = Part
  274.  
  275. for i = 0,80,10 do
  276.     local Part = Instance.new("Part",Model)
  277.     Part.CanCollide = false
  278.     Part.Position = Vector3.new(0,100,0)
  279.     Part:BreakJoints()
  280.     Part.FormFactor = "Custom"
  281.     Part.Size = Vector3.new(0.2,0.2,0.2)
  282.     Part.TopSurface = "SmoothNoOutlines"
  283.     Part.BottomSurface = "SmoothNoOutlines"
  284.     Part.FrontSurface = "SmoothNoOutlines"
  285.     Part.BackSurface = "SmoothNoOutlines"
  286.     Part.RightSurface = "SmoothNoOutlines"
  287.     Part.LeftSurface = "SmoothNoOutlines"
  288.     Part.BrickColor = BrickColor.new("Black")
  289.     local Mesh = Instance.new("BlockMesh",Part)
  290.     Mesh.Scale = Vector3.new(0.25,0.15,0.03555*2) / 0.2 * Scale
  291.     local PartWeld = Instance.new("Motor6D")
  292.     PartWeld.Part0 = Handle
  293.     PartWeld.Part1 = Part
  294.     PartWeld.C0 = CFrame.new(Vector3.new(0,0.15,0.315)*Scale) * CFrame.Angles(math.rad(i-65),0,0) * CFrame.new(Vector3.new(0,0.2,0)*Scale)
  295.     PartWeld.Parent = Part
  296. end
  297.  
  298. local Barrel = Instance.new("Part",Model)
  299. Barrel.CanCollide = false
  300. Barrel.Position = Vector3.new(0,100,0)
  301. Barrel:BreakJoints()
  302. Barrel.FormFactor = "Custom"
  303. Barrel.Size = Vector3.new(0.2,0.2,0.2)
  304. Barrel.TopSurface = "SmoothNoOutlines"
  305. Barrel.BottomSurface = "SmoothNoOutlines"
  306. Barrel.FrontSurface = "SmoothNoOutlines"
  307. Barrel.BackSurface = "SmoothNoOutlines"
  308. Barrel.RightSurface = "SmoothNoOutlines"
  309. Barrel.LeftSurface = "SmoothNoOutlines"
  310. Barrel.BrickColor = BrickColor.new("Black")
  311. local Mesh = Instance.new("BlockMesh",Barrel)
  312. Mesh.Scale = Vector3.new(0.25,0.2,2) / 0.2 * Scale
  313. local BarrelWeld = Instance.new("Motor6D")
  314. BarrelWeld.Part0 = Handle
  315. BarrelWeld.Part1 = Barrel
  316. BarrelWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.5,-0.7)*Scale)
  317. BarrelWeld.Parent = Barrel
  318.  
  319. local Barrel1 = Barrel
  320.  
  321. local Barrel2 = Instance.new("Part",Model)
  322. Barrel2.CanCollide = false
  323. Barrel2.Position = Vector3.new(0,100,0)
  324. Barrel2:BreakJoints()
  325. Barrel2.FormFactor = "Custom"
  326. Barrel2.Size = Vector3.new(0.2,0.2,0.2)
  327. Barrel2.TopSurface = "SmoothNoOutlines"
  328. Barrel2.BottomSurface = "SmoothNoOutlines"
  329. Barrel2.FrontSurface = "SmoothNoOutlines"
  330. Barrel2.BackSurface = "SmoothNoOutlines"
  331. Barrel2.RightSurface = "SmoothNoOutlines"
  332. Barrel2.LeftSurface = "SmoothNoOutlines"
  333. Barrel2.BrickColor = BrickColor.new("Really black")
  334. local Mesh = Instance.new("BlockMesh",Barrel2)
  335. Mesh.Scale = Vector3.new(0.25,0.25,2) / 0.2 * Scale
  336. local Barrel2Weld = Instance.new("Motor6D")
  337. Barrel2Weld.Part0 = Barrel
  338. Barrel2Weld.Part1 = Barrel2
  339. Barrel2Weld.C0 = CFrame.new(Vector3.new(0,0.225,0)*Scale)
  340. Barrel2Weld.Parent = Barrel2
  341.  
  342. local RealBarrel = Instance.new("Part",Model)
  343. RealBarrel.CanCollide = false
  344. RealBarrel.Position = Vector3.new(0,100,0)
  345. RealBarrel:BreakJoints()
  346. RealBarrel.FormFactor = "Custom"
  347. RealBarrel.Size = Vector3.new(0.2,0.2,0.2)
  348. RealBarrel.TopSurface = "SmoothNoOutlines"
  349. RealBarrel.BottomSurface = "SmoothNoOutlines"
  350. RealBarrel.FrontSurface = "SmoothNoOutlines"
  351. RealBarrel.BackSurface = "SmoothNoOutlines"
  352. RealBarrel.RightSurface = "SmoothNoOutlines"
  353. RealBarrel.LeftSurface = "SmoothNoOutlines"
  354. RealBarrel.BrickColor = BrickColor.new("Dark grey metallic")
  355. local Mesh = Instance.new("CylinderMesh",RealBarrel)
  356. Mesh.Scale = Vector3.new(0.2,2,0.2) / 0.2 * Scale
  357. local RealBarrelWeld = Instance.new("Motor6D")
  358. RealBarrelWeld.Part0 = Barrel
  359. RealBarrelWeld.Part1 = RealBarrel
  360. RealBarrelWeld.C0 = CFrame.new(Vector3.new(0,0.1,-0.01)*Scale) * CFrame.Angles(math.rad(-90),0,0)
  361. RealBarrelWeld.Parent = RealBarrel
  362.  
  363. for i = 1,75,15 do
  364.     local Part = Instance.new("Part",Model)
  365.     Part.CanCollide = false
  366.     Part.Position = Vector3.new(0,100,0)
  367.     Part:BreakJoints()
  368.     Part.FormFactor = "Custom"
  369.     Part.Size = Vector3.new(0.2,0.2,0.2)
  370.     Part.TopSurface = "SmoothNoOutlines"
  371.     Part.BottomSurface = "SmoothNoOutlines"
  372.     Part.FrontSurface = "SmoothNoOutlines"
  373.     Part.BackSurface = "SmoothNoOutlines"
  374.     Part.RightSurface = "SmoothNoOutlines"
  375.     Part.LeftSurface = "SmoothNoOutlines"
  376.     Part.BrickColor = BrickColor.new("Black")
  377.     local Mesh = Instance.new("BlockMesh",Part)
  378.     Mesh.Scale = Vector3.new(0.05,0.065,0.05) / 0.2 * Scale
  379.     local PartWeld = Instance.new("Motor6D")
  380.     PartWeld.Part0 = Handle
  381.     PartWeld.Part1 = Part
  382.     PartWeld.C0 = CFrame.new(Vector3.new(0,0.525,-0.515)*Scale) * CFrame.Angles(math.rad(i),0,0) * CFrame.new(Vector3.new(0,0,0.2)*Scale)
  383.     PartWeld.Parent = Part
  384. end
  385.  
  386. local Part = Instance.new("Part",Model)
  387. Part.CanCollide = false
  388. Part.Position = Vector3.new(0,100,0)
  389. Part:BreakJoints()
  390. Part.FormFactor = "Custom"
  391. Part.Size = Vector3.new(0.2,0.2,0.2)
  392. Part.TopSurface = "SmoothNoOutlines"
  393. Part.BottomSurface = "SmoothNoOutlines"
  394. Part.FrontSurface = "SmoothNoOutlines"
  395. Part.BackSurface = "SmoothNoOutlines"
  396. Part.RightSurface = "SmoothNoOutlines"
  397. Part.LeftSurface = "SmoothNoOutlines"
  398. Part.BrickColor = BrickColor.new("Really black")
  399. local Mesh = Instance.new("BlockMesh",Part)
  400. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  401. local PartWeld = Instance.new("Motor6D")
  402. PartWeld.Part0 = Barrel2
  403. PartWeld.Part1 = Part
  404. PartWeld.C0 = CFrame.new(Vector3.new(0.06,0.135,0.925)*Scale)
  405. PartWeld.Parent = Part
  406.  
  407. local Part = Instance.new("Part",Model)
  408. Part.CanCollide = false
  409. Part.Position = Vector3.new(0,100,0)
  410. Part:BreakJoints()
  411. Part.FormFactor = "Custom"
  412. Part.Size = Vector3.new(0.2,0.2,0.2)
  413. Part.TopSurface = "SmoothNoOutlines"
  414. Part.BottomSurface = "SmoothNoOutlines"
  415. Part.FrontSurface = "SmoothNoOutlines"
  416. Part.BackSurface = "SmoothNoOutlines"
  417. Part.RightSurface = "SmoothNoOutlines"
  418. Part.LeftSurface = "SmoothNoOutlines"
  419. Part.BrickColor = BrickColor.new("Really black")
  420. local Mesh = Instance.new("BlockMesh",Part)
  421. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  422. local PartWeld = Instance.new("Motor6D")
  423. PartWeld.Part0 = Barrel2
  424. PartWeld.Part1 = Part
  425. PartWeld.C0 = CFrame.new(Vector3.new(-0.06,0.135,0.925)*Scale)
  426. PartWeld.Parent = Part
  427.  
  428. local Part = Instance.new("Part",Model)
  429. Part.CanCollide = false
  430. Part.Position = Vector3.new(0,100,0)
  431. Part:BreakJoints()
  432. Part.FormFactor = "Custom"
  433. Part.Size = Vector3.new(0.2,0.2,0.2)
  434. Part.TopSurface = "SmoothNoOutlines"
  435. Part.BottomSurface = "SmoothNoOutlines"
  436. Part.FrontSurface = "SmoothNoOutlines"
  437. Part.BackSurface = "SmoothNoOutlines"
  438. Part.RightSurface = "SmoothNoOutlines"
  439. Part.LeftSurface = "SmoothNoOutlines"
  440. Part.BrickColor = BrickColor.new("Really black")
  441. local Mesh = Instance.new("BlockMesh",Part)
  442. Mesh.Scale = Vector3.new(0.025,0.1,0.1) / 0.2 * Scale
  443. local PartWeld = Instance.new("Motor6D")
  444. PartWeld.Part0 = Barrel2
  445. PartWeld.Part1 = Part
  446. PartWeld.C0 = CFrame.new(Vector3.new(0,0.135,-0.925)*Scale)
  447. PartWeld.Parent = Part
  448.  
  449. local Part = Instance.new("Part",Model)
  450. Part.CanCollide = false
  451. Part.Position = Vector3.new(0,100,0)
  452. Part:BreakJoints()
  453. Part.FormFactor = "Custom"
  454. Part.Size = Vector3.new(0.2,0.2,0.2)
  455. Part.Transparency = 1
  456. Part.TopSurface = "SmoothNoOutlines"
  457. Part.BottomSurface = "SmoothNoOutlines"
  458. Part.FrontSurface = "SmoothNoOutlines"
  459. Part.BackSurface = "SmoothNoOutlines"
  460. Part.RightSurface = "SmoothNoOutlines"
  461. Part.LeftSurface = "SmoothNoOutlines"
  462. Part.BrickColor = BrickColor.new("Really black")
  463. local Mesh = Instance.new("BlockMesh",Part)
  464. Mesh.Scale = Vector3.new(0.1,0.1,0.1) / 0.2 * Scale
  465. local PartWeld = Instance.new("Motor6D")
  466. PartWeld.Part0 = Barrel
  467. PartWeld.Part1 = Part
  468. PartWeld.C0 = CFrame.new(Vector3.new(0,0,-5)*Scale)
  469. PartWeld.Parent = Part
  470.  
  471. local Light = Instance.new("PointLight",Part)
  472. Light.Color = BrickColor.new("Gold").Color
  473. Light.Enabled = true
  474. Light.Shadows = true
  475. Light.Brightness = 0
  476. Light.Range = 6
  477.  
  478. local Part = Instance.new("Part",Model)
  479. Part.Material = "Neon"
  480. Part.CanCollide = false
  481. Part.Position = Vector3.new(0,100,0)
  482. Part:BreakJoints()
  483. Part.FormFactor = "Custom"
  484. Part.Size = Vector3.new(0.2,0.2,0.2)
  485. Part.TopSurface = "SmoothNoOutlines"
  486. Part.BottomSurface = "SmoothNoOutlines"
  487. Part.FrontSurface = "SmoothNoOutlines"
  488. Part.BackSurface = "SmoothNoOutlines"
  489. Part.RightSurface = "SmoothNoOutlines"
  490. Part.LeftSurface = "SmoothNoOutlines"
  491. Part.BrickColor = BrickColor.new("Bright yellow")
  492. Part.Transparency = 0.25
  493. local RecoilMesh = Instance.new("SpecialMesh",Part)
  494. RecoilMesh.MeshType = "FileMesh"
  495. RecoilMesh.MeshId = "http://www.roblox.com/Asset/?id=1323306"
  496. RecoilMesh.TextureId = "http://www.roblox.com/Asset/?id=98896228"
  497. RecoilMesh.Scale = Vector3.new(0.175,0,0.175) * Scale
  498. local PartWeld = Instance.new("Motor6D")
  499. PartWeld.Part0 = RealBarrel
  500. PartWeld.Part1 = Part
  501. PartWeld.C0 = CFrame.new(Vector3.new(0,0.95,0)*Scale)
  502. PartWeld.Parent = Part
  503.  
  504. function ShootBullet(Target,barrel)
  505.     local barrel = barrel or Barrel
  506.     local Bullet = Instance.new("Part",Workspace)
  507.     Barrel.CanCollide = false
  508.     Bullet.FormFactor = "Custom"
  509.     Bullet.Size = Vector3.new(0.2,0.2,5)*Scale
  510.     Bullet.TopSurface = "Smooth"
  511.     Bullet.BottomSurface = "Smooth"
  512.     Bullet.Anchored = true
  513.     Bullet.CanCollide = false
  514.     Bullet.CFrame = CFrame.new((barrel.CFrame*CFrame.new(0,0,-barrel.Size.Z*barrel.Mesh.Scale.Z/2)).p,Target)*CFrame.new(0,0,-Bullet.Size.Z/2)
  515.     Bullet.Transparency = 0.1
  516.     Bullet.BrickColor = BrickColor.new("Gold")
  517.     --[[local Mesh = Instance.new("SpecialMesh",Bullet)
  518.     Mesh.MeshType = "FileMesh"
  519.     Mesh.Scale = Vector3.new(0.5,0.5,0.2)
  520.     Mesh.MeshId = "http://www.roblox.com/asset/?id=2697549"
  521.     --Mesh.TextureId = "http://www.roblox.com/asset/?id=2697544"]]
  522.     local Mesh = Instance.new("BlockMesh",Bullet)
  523.     Mesh.Scale = Vector3.new(0.2,0.2,5)*Scale/Bullet.Size
  524.     IgnoreList[#IgnoreList+1] = Bullet
  525.     RenderStepped:wait()
  526.     for i = Speed,1000,Speed do -- Loop to do the bullet movement and stuff.
  527.         local ray,Hit,Pos,SurfaceNormal;
  528.         ray = Ray.new(Bullet.Position,((Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)).p-Bullet.Position).unit*Speed)
  529.         Hit,Pos,SurfaceNormal = Workspace:FindPartOnRayWithIgnoreList(ray,IgnoreList)
  530.         Bullet.CFrame = Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)
  531.         if Hit ~= nil then
  532.             local Hum = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  533.             if Hum ~= nil then
  534.                 Hum:TakeDamage((((Gangster and math.random(50,60) or math.random(30,40))*Scale)/100)*Hum.MaxHealth)
  535.             end
  536.             break
  537.         end
  538.         RenderStepped:wait()
  539.     end
  540.     Bullet:Destroy()
  541. end
  542.  
  543. Mouse.Button1Down:connect(function()
  544.     if not Down and not DB then
  545.         Down = true
  546.         while Down do
  547.             if Humanoid.Health == 0 then break end
  548.             if not DB then
  549.                 DB = true
  550.                 local Sound = Instance.new("Sound",Barrel)
  551.                 Sound.SoundId = "http://www.roblox.com/Asset/?id=165946426" -- 132373574
  552.                 Sound.Volume = 5
  553.                 Sound.Pitch = math.random(70,110)/100
  554.                 Sound:Play()
  555.                 Spawn(function()
  556.                     ShootBullet(Mouse.Hit.p,Barrel1)
  557.                 end)
  558.                 RecoilMesh.VertexColor = Vector3.new(1,math.random(160,245)/255,20/255)
  559.                 PartWeld.C0 = PartWeld.C0 * CFrame.Angles(0,math.rad(math.random(-40,40)),0)
  560.                 local Shell = Instance.new("Part",Workspace)
  561.                 Shell.FormFactor = "Custom"
  562.                 Shell.BrickColor = BrickColor.new("Bright yellow")
  563.                 Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale
  564.                 Shell.CFrame = Barrel.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0)
  565.                 Shell.Velocity = ((Barrel.CFrame*CFrame.new(5,0,math.random(-2,2))).p-Barrel.CFrame.p)*5*Scale
  566.                 local Mesh = Instance.new("CylinderMesh",Shell)
  567.                 Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size
  568.                 Spawn(function()
  569.                     wait(5)
  570.                     Shell:Destroy()
  571.                 end)
  572.                 for i = 1,20,7.5 do
  573.                     RotationOffset = RotationOffset*CFrame.Angles(math.rad(7.5),0,0)
  574.                     Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,-0.15,0)*Scale)
  575.                     Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,0.15)*Scale)
  576.                     Light.Brightness = Light.Brightness+38
  577.                     RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,0.375,0)*Scale)
  578.                     RenderStepped:wait()
  579.                 end
  580.                 wait(0.02)
  581.                 for i = 1,20,3.75 do
  582.                     RotationOffset = RotationOffset*CFrame.Angles(math.rad(-3.75),0,0)
  583.                     Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,0.075,0)*Scale)
  584.                     Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,-0.075)*Scale)
  585.                     Light.Brightness = Light.Brightness-19
  586.                     RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,-0.1875,0)*Scale)
  587.                     RenderStepped:wait()
  588.                 end
  589.                 wait(0.02)
  590.                 DB = false
  591.             end
  592.         end
  593.     end
  594. end)
  595.  
  596. Mouse.Button1Up:connect(function()
  597.     Down = false
  598. end)
  599.  
  600. Mouse.KeyDown:connect(function(Key)
  601.     if Key:lower() == "g" and not DB then
  602.         DB = true
  603.         if Gangster == true then
  604.             for i = 1,70,5 do
  605.                 RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(-5),0)
  606.                 RenderStepped:wait()
  607.             end
  608.             Gangster = false
  609.         else
  610.             for i = 1,70,5 do
  611.                 RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(5),0)
  612.                 RenderStepped:wait()
  613.             end
  614.             Gangster = true
  615.         end
  616.         DB = false
  617.     end
  618. end)
  619.  
  620. local Weld = Instance.new("Weld")
  621. Weld.Part0 = Torso
  622. Weld.Part1 = Character["Right Arm"]
  623. Weld.Parent = Torso
  624.  
  625. local Weld2 = Instance.new("Weld")
  626. Weld2.Part0 = Torso
  627. Weld2.Part1 = Character.Head
  628. Weld2.Parent = Torso
  629.  
  630. while true do
  631.     local Point = Torso.CFrame:vectorToObjectSpace(Mouse.Hit.p-Torso.CFrame.p)
  632.     if Point.Z > 0 then
  633.         if Point.X > 0 then
  634.             Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  635.         elseif Point.X < 0 then
  636.             Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  637.         end
  638.     end
  639.     local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,Mouse.Hit.p))--RayEnd))
  640.     Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
  641.     Weld.C1 = Part1Joint
  642.     Weld.Part0 = Torso
  643.     Weld.Part1 = Character["Right Arm"]
  644.     local CFr = (Torso.CFrame*Part0JointHead):toObjectSpace(CFrame.new((Torso.CFrame*Part0JointHead).p,Mouse.Hit.p))--RayEnd))
  645.     Weld2.C0 = Part0JointHead * (CFr-CFr.p) * RotationOffsetHead
  646.     Weld2.C1 = Part1JointHead
  647.     Weld2.Part0 = Torso
  648.     Weld2.Part1 = Character.Head
  649.     local Last = Scale
  650.     Scale = game.Players.LocalPlayer.Character.Torso.Size.Y/2
  651.     Speed = 10*Scale
  652.     if Scale ~= Last then
  653.         Part0Joint = CFrame.new(Torso.Size.X/2,Torso.Size.Y*(0.75/2),0)
  654.         Part1Joint = CFrame.new(-Character["Right Arm"].Size.X/2,(0.75/2)*Character["Right Arm"].Size.Y,0)
  655.         Part0JointHead = CFrame.new(0,Torso.Size.Y/2,0)
  656.         Part1JointHead = CFrame.new(0,-Character.Head.Size.Y/2,0)
  657.     end
  658.     RenderStepped:wait()
  659. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement