Sinderblock

[LUA, SB COMPATABLE] Shotgun

Jun 23rd, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.12 KB | None | 0 0
  1. Player = game.Players.LocalPlayer
  2. Character = Player.Character
  3. script.Parent = Character
  4.  
  5. --[[ * Fire Handle * ]]--
  6.  
  7. pcall(function() Character.Gun:Remove() end)
  8.  
  9. Gun = Instance.new("Model")
  10. Gun.Name = "Gun"
  11. Gun.Parent = Character
  12.  
  13. --[[ * Arm Weld * ]]--
  14.  
  15. ArmWeld = Instance.new("Weld")
  16. ArmWeld.Parent = Character["Torso"]
  17. ArmWeld.Part0 = ArmWeld.Parent
  18. ArmWeld.Part1 = Character["Right Arm"]
  19. ArmWeld.C0 = CFrame.new(1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)
  20.  
  21. --[[ * Arm Weld * ]]--
  22.  
  23. ArmWeldR = Instance.new("Weld")
  24. ArmWeldR.Parent = Character["Torso"]
  25. ArmWeldR.Part0 = ArmWeldR.Parent
  26. ArmWeldR.Part1 = Character["Left Arm"]
  27. ArmWeldR.C0 = CFrame.new(-1.5,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  28.  
  29. --[[ * Neck Weld * ]]--
  30.  
  31. Neck = Instance.new("Weld")
  32. Neck.Parent = Character["Torso"]
  33. Neck.Part0 = Neck.Parent
  34. Neck.Part1 = Character["Head"]
  35. Neck.C0 = CFrame.new(0,1.5,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  36.  
  37. --[[ * Handle * ]]--
  38.  
  39. Handle = Instance.new("Part")
  40. Handle.formFactor = "Custom"
  41. Handle.Locked = true
  42. Handle.CanCollide = false
  43. Handle.BrickColor = BrickColor.new("Medium stone grey")
  44. Handle.Anchored = false
  45. Handle.Size = Vector3.new(0.25,0.7,0.25)
  46. Handle.TopSurface = 0
  47. Handle.BottomSurface = 0
  48. Handle.Parent = Gun
  49. MeshA = Instance.new("BlockMesh",Handle)
  50. MeshA.Bevel = 0.03
  51. WeldA = Instance.new("Weld")
  52. WeldA.Parent = Handle
  53. WeldA.Part0 = Character["Right Arm"]
  54. WeldA.Part1 = Handle
  55. WeldA.C0 = CFrame.new(0,-1.1,-0.2) * CFrame.Angles(-math.pi/2-0.1,0,0)
  56.  
  57. --[[ * Cartrage * ]]--
  58.  
  59. Cartrage = Instance.new("Part")
  60. Cartrage.formFactor = "Custom"
  61. Cartrage.Locked = true
  62. Cartrage.CanCollide = false
  63. Cartrage.BrickColor = BrickColor.new("Really black")
  64. Cartrage.Anchored = false
  65. Cartrage.Size = Vector3.new(0.2,0.5,0.2)
  66. Cartrage.TopSurface = 0
  67. Cartrage.BottomSurface = 0
  68. Cartrage.Parent = Gun
  69. MeshB = Instance.new("BlockMesh",Cartrage)
  70. MeshB.Bevel = 0.03
  71. WeldB = Instance.new("Weld")
  72. WeldB.Parent = Cartrage
  73. WeldB.Part0 = Handle
  74. WeldB.Part1 = Cartrage
  75. WeldB.C0 = CFrame.new(0,0,0) * CFrame.Angles(0,0,0)
  76.  
  77. --[[ * Trigger * ]]--
  78.  
  79. Trigger = Instance.new("Part")
  80. Trigger.formFactor = "Custom"
  81. Trigger.Locked = true
  82. Trigger.CanCollide = false
  83. Trigger.BrickColor = BrickColor.new("Really black")
  84. Trigger.Anchored = false
  85. Trigger.Size = Vector3.new(0.2,0.4,0.4)
  86. Trigger.TopSurface = 0
  87. Trigger.BottomSurface = 0
  88. Trigger.Parent = Gun
  89. MeshB = Instance.new("BlockMesh",Trigger)
  90. MeshB.Bevel = 0.03
  91. WeldB = Instance.new("Weld")
  92. WeldB.Parent = Trigger
  93. WeldB.Part0 = Handle
  94. WeldB.Part1 = Trigger
  95. WeldB.C0 = CFrame.new(0,0.21,-0.09) * CFrame.Angles(0,0,0)
  96.  
  97. --[[ * BWall * ]]--
  98.  
  99. BWall = Instance.new("Part")
  100. BWall.formFactor = "Custom"
  101. BWall.Locked = true
  102. BWall.CanCollide = false
  103. BWall.BrickColor = BrickColor.new("Medium stone grey")
  104. BWall.Anchored = false
  105. BWall.Size = Vector3.new(0.25,0.6,0.25)
  106. BWall.TopSurface = 0
  107. BWall.BottomSurface = 0
  108. BWall.Parent = Gun
  109. MeshB = Instance.new("BlockMesh",BWall)
  110. MeshB.Bevel = 0.03
  111. WeldB = Instance.new("Weld")
  112. WeldB.Parent = BWall
  113. WeldB.Part0 = Handle
  114. WeldB.Part1 = BWall
  115. WeldB.C0 = CFrame.new(0,0.3,-0.3) * CFrame.Angles(math.pi/2+0.1,0,0)
  116.  
  117. --[[ * CWall * ]]--
  118.  
  119. CWall = Instance.new("Part")
  120. CWall.formFactor = "Custom"
  121. CWall.Locked = true
  122. CWall.CanCollide = false
  123. CWall.BrickColor = BrickColor.new("Really black")
  124. CWall.Anchored = false
  125. CWall.Size = Vector3.new(0.3,0.6,0.2)
  126. CWall.TopSurface = 0
  127. CWall.BottomSurface = 0
  128. CWall.Parent = Gun
  129. MeshB = Instance.new("BlockMesh",CWall)
  130. MeshB.Bevel = 0.03
  131. WeldB = Instance.new("Weld")
  132. WeldB.Parent = CWall
  133. WeldB.Part0 = Handle
  134. WeldB.Part1 = CWall
  135. WeldB.C0 = CFrame.new(0,0.4,-0.3) * CFrame.Angles(math.pi/2+0.1,0,0)
  136.  
  137. --[[ * ButA * ]]--
  138.  
  139. ButA = Instance.new("Part")
  140. ButA.formFactor = "Custom"
  141. ButA.Locked = true
  142. ButA.CanCollide = false
  143. ButA.BrickColor = BrickColor.new("Really black")
  144. ButA.Anchored = false
  145. ButA.Size = Vector3.new(0.3,0.6,0.3)
  146. ButA.TopSurface = 0
  147. ButA.BottomSurface = 0
  148. ButA.Parent = Gun
  149. MeshB = Instance.new("CylinderMesh",ButA)
  150. MeshB.Bevel = 0.03
  151. WeldB = Instance.new("Weld")
  152. WeldB.Parent = ButA
  153. WeldB.Part0 = Handle
  154. WeldB.Part1 = ButA
  155. WeldB.C0 = CFrame.new(0.1,0.4,-0.3) * CFrame.Angles(math.pi/2+0.1,0,0)
  156.  
  157. --[[ * ButB * ]]--
  158.  
  159. ButB = Instance.new("Part")
  160. ButB.formFactor = "Custom"
  161. ButB.Locked = true
  162. ButB.CanCollide = false
  163. ButB.BrickColor = BrickColor.new("Really black")
  164. ButB.Anchored = false
  165. ButB.Size = Vector3.new(0.3,0.6,0.3)
  166. ButB.TopSurface = 0
  167. ButB.BottomSurface = 0
  168. ButB.Parent = Gun
  169. MeshB = Instance.new("CylinderMesh",ButB)
  170. MeshB.Bevel = 0.03
  171. WeldB = Instance.new("Weld")
  172. WeldB.Parent = ButB
  173. WeldB.Part0 = Handle
  174. WeldB.Part1 = ButB
  175. WeldB.C0 = CFrame.new(-0.1,0.4,-0.3) * CFrame.Angles(math.pi/2+0.1,0,0)
  176.  
  177. --[[ * Hinge * ]]--
  178.  
  179. Hinge = Instance.new("Part")
  180. Hinge.formFactor = "Custom"
  181. Hinge.Locked = true
  182. Hinge.CanCollide = false
  183. Hinge.BrickColor = BrickColor.new("Medium stone grey")
  184. Hinge.Anchored = false
  185. Hinge.Size = Vector3.new(0.2,0.25,0.2)
  186. Hinge.TopSurface = 0
  187. Hinge.BottomSurface = 0
  188. Hinge.Parent = Gun
  189. MeshB = Instance.new("CylinderMesh",Hinge)
  190. MeshB.Bevel = 0.03
  191. WeldQ = Instance.new("Weld")
  192. WeldQ.Parent = Hinge
  193. WeldQ.Part0 = Handle
  194. WeldQ.Part1 = Hinge
  195. WeldQ.C0 = CFrame.new(0,0.3,-0.6) * CFrame.Angles(math.pi/2+0.1,0,math.pi/2)
  196.  
  197. --[[ * HingeP * ]]--
  198.  
  199. HingeP = Instance.new("Part")
  200. HingeP.formFactor = "Custom"
  201. HingeP.Locked = true
  202. HingeP.CanCollide = false
  203. HingeP.BrickColor = BrickColor.new("Medium stone grey")
  204. HingeP.Anchored = false
  205. HingeP.Size = Vector3.new(0.2,0.5,0.2)
  206. HingeP.TopSurface = 0
  207. HingeP.BottomSurface = 0
  208. HingeP.Parent = Gun
  209. MeshB = Instance.new("CylinderMesh",HingeP)
  210. MeshB.Bevel = 0.1
  211. WeldB = Instance.new("Weld")
  212. WeldB.Parent = HingeP
  213. WeldB.Part0 = Hinge
  214. WeldB.Part1 = HingeP
  215. WeldB.C0 = CFrame.new(-0.25,0,0) * CFrame.Angles(0,0,math.pi/2)
  216.  
  217. --[[ * BarrelA * ]]--
  218.  
  219. BarrelA = Instance.new("Part")
  220. BarrelA.formFactor = "Custom"
  221. BarrelA.Locked = true
  222. BarrelA.CanCollide = false
  223. BarrelA.BrickColor = BrickColor.new("Really black")
  224. BarrelA.Anchored = false
  225. BarrelA.Size = Vector3.new(0.3,1.5,0.3)
  226. BarrelA.TopSurface = 0
  227. BarrelA.BottomSurface = 0
  228. BarrelA.Parent = Gun
  229. MeshB = Instance.new("CylinderMesh",BarrelA)
  230. MeshB.Bevel = 0.03
  231. WeldB = Instance.new("Weld")
  232. WeldB.Parent = BarrelA
  233. WeldB.Part0 = Hinge
  234. WeldB.Part1 = BarrelA
  235. WeldB.C0 = CFrame.new(-0.75,0.1,-0.125) * CFrame.Angles(0,0,math.pi/2)
  236.  
  237. --[[ * BarrelB * ]]--
  238.  
  239. BarrelB = Instance.new("Part")
  240. BarrelB.formFactor = "Custom"
  241. BarrelB.Locked = true
  242. BarrelB.CanCollide = false
  243. BarrelB.BrickColor = BrickColor.new("Really black")
  244. BarrelB.Anchored = false
  245. BarrelB.Size = Vector3.new(0.3,1.5,0.3)
  246. BarrelB.TopSurface = 0
  247. BarrelB.BottomSurface = 0
  248. BarrelB.Parent = Gun
  249. MeshB = Instance.new("CylinderMesh",BarrelB)
  250. MeshB.Bevel = 0.03
  251. WeldB = Instance.new("Weld")
  252. WeldB.Parent = BarrelB
  253. WeldB.Part0 = Hinge
  254. WeldB.Part1 = BarrelB
  255. WeldB.C0 = CFrame.new(-0.75,-0.1,-0.125) * CFrame.Angles(0,0,math.pi/2)
  256.  
  257. --[[ * Variables * ]]--
  258.  
  259. Head = false
  260. Ammo = 2
  261. Arms = false
  262. Hopper = Instance.new("HopperBin")
  263.  
  264. function TName()
  265. Hopper.Name = "Gun: "..Ammo
  266. end
  267.  
  268. --[[ * Animation * ]]--
  269.  
  270. function ArmsOn()
  271. for i = 1,10 do wait()
  272. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,math.pi/10/2/2)
  273. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05)
  274. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,-math.pi/10/2/2/2)
  275. ArmWeld.C0 = ArmWeld.C0 + Vector3.new(-0.05,0,0.09)
  276. end
  277. end
  278.  
  279. function ArmsOff()
  280. for i = 1,10 do wait()
  281. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05)
  282. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2)
  283. ArmWeld.C0 = ArmWeld.C0 - Vector3.new(-0.05,0,0.09)
  284. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,math.pi/10/2/2/2)
  285. end
  286. for i = 1,3 do wait()
  287. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(0,0,0.05)
  288. end
  289. ArmWeldR.C0 = CFrame.new(-1.5,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  290. end
  291.  
  292. function SuicideYes()
  293. for i = 1,10 do wait()
  294. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,math.pi/10/2/2)
  295. WeldA.C0 = WeldA.C0 * CFrame.Angles(0,math.pi/11,0)
  296. end
  297. end
  298.  
  299. function SuicideNo()
  300. for i = 1,10 do wait()
  301. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,-math.pi/10/2/2)
  302. WeldA.C0 = WeldA.C0 * CFrame.Angles(0,-math.pi/11,0)
  303. end
  304. end
  305.  
  306. function Reload()
  307. if Ammo == 0 then
  308. if Head == true then SuicideNo() end
  309. NewSoundI("http://www.roblox.com/Asset/?id=2761842",10,1,Handle,1.2)
  310. if Arms == false then
  311. for i = 1,10 do wait()
  312. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,math.pi/10/2/2)
  313. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05)
  314. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,-math.pi/10/2/2/2)
  315. ArmWeld.C0 = ArmWeld.C0 + Vector3.new(-0.05,0,0.09)
  316. end
  317. end
  318. for i = 1,10 do wait()
  319. WeldQ.C0 = WeldQ.C0 * CFrame.Angles(0,math.pi/10/2/2,0)
  320. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2/2/2,0,0)
  321. end
  322. for i = 1,10 do wait()
  323. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2/2/2,0,0)
  324. end
  325. for i = 1,9 do wait()
  326. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05)
  327. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2)
  328. end
  329. for i = 1,3 do wait()
  330. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(-0.1,0.05,-0.05)
  331. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,math.pi/10/2/2)
  332. end
  333. for i = 1,3 do wait()
  334. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(-0.1,0.05,-0.05)
  335. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,-math.pi/10/2/2)
  336. end
  337. for i = 1,9 do wait()
  338. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05)
  339. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,math.pi/10/2/2)
  340. end
  341. for i = 1,5 do wait()
  342. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/4/2/2/2,0,0)
  343. end
  344. Ammo = 1
  345. TName()
  346. NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle)
  347. for i = 1,5 do wait()
  348. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/4/2/2/2,0,0)
  349. end
  350. NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle)
  351. for i = 1,9 do wait()
  352. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05)
  353. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2)
  354. end
  355. for i = 1,3 do wait()
  356. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(-0.1,0.05,-0.05)
  357. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,math.pi/10/2/2)
  358. end
  359. for i = 1,3 do wait()
  360. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(-0.1,0.05,-0.05)
  361. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,-math.pi/10/2/2)
  362. end
  363. for i = 1,9 do wait()
  364. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0.1,0.05,-0.05)
  365. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/10/2,-math.pi/11/2/2,math.pi/10/2/2)
  366. end
  367. for i = 1,5 do wait()
  368. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/4/2/2/2,0,0)
  369. end
  370. Ammo = 2
  371. TName()
  372. NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle)
  373. for i = 1,5 do wait()
  374. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/4/2/2/2,0,0)
  375. end
  376. NewSound("http://www.roblox.com/Asset/?id=13510352",2,10,Handle)
  377. for i = 1,10 do wait()
  378. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/10/2,math.pi/11/2/2,-math.pi/10/2/2)
  379. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0.1,0.05,-0.05)
  380. end
  381. for i = 1,10 do wait()
  382. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(0,0,0.05)
  383. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(0,0,math.pi/10/2/2/2)
  384. ArmWeld.C0 = ArmWeld.C0 - Vector3.new(-0.05,0,0.09)
  385. end
  386. ArmWeldR.C0 = CFrame.new(-1.5,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  387. NewSound("http://www.roblox.com/Asset/?id=10209881",10,0.9,Handle)
  388. for i = 1,5 do wait()
  389. WeldQ.C0 = WeldQ.C0 * CFrame.Angles(0,-math.pi/5/2/2,0)
  390. ArmWeld.C0 = ArmWeld.C0 * CFrame.new(0,0,-0.1) * CFrame.Angles(math.pi/5/2/2,0,0)
  391. end
  392. for i = 1,10 do wait()
  393. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(-math.pi/10/2/2,0,0) * CFrame.new(0,0,0.05)
  394. end
  395. ArmWeld.C0 = CFrame.new(1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)
  396. Ammo = 2
  397. TName()
  398. if Head == true then SuicideYes() end
  399. if Arms == true then ArmsOn() end
  400. elseif Ammo ~= 0 then
  401. if Arms == false then ArmsOn() end
  402. wait(0.1)
  403. NewSound("http://www.roblox.com/Asset/?id=10209881",10,1,Handle)
  404. for i = 1,10 do wait()
  405. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0,0.1)
  406. end
  407. --Ammo = Ammo - 1
  408. TName()
  409. for i = 1,10 do wait()
  410. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0,0.1)
  411. end
  412. if Arms == false then ArmsOff() end
  413. end
  414. end
  415.  
  416. function Shoot()
  417. NewSound("http://www.roblox.com/Asset/?id=2691586",10,1,Handle)
  418. if Arms == false then
  419. for i = 1,5 do wait()
  420. ArmWeld.C0 = ArmWeld.C0 * CFrame.new(0,0,-0.1) * CFrame.Angles(math.pi/5/2/2,0,0)
  421. WeldA.C0 = WeldA.C0 * CFrame.Angles(0.2,0,0)
  422. end
  423. for i = 1,10 do wait()
  424. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(-math.pi/10/2/2,0,0) * CFrame.new(0,0,0.05)
  425. WeldA.C0 = WeldA.C0 * CFrame.Angles(-0.1,0,0)
  426. end
  427. if Arms == false then ArmsOn() end
  428. wait(0.05)
  429. NewSound("http://www.roblox.com/Asset/?id=10209881",10,1,Handle)
  430. for i = 1,5 do wait()
  431. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0,0.2)
  432. end
  433. Ammo = Ammo - 1 TName()
  434. wait(0.1)
  435. for i = 1,5 do wait()
  436. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0,0.2)
  437. end
  438. if Arms == false then ArmsOff() end
  439. elseif Arms == true then
  440. for i = 1,5 do wait()
  441. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(math.pi/4/2/2/2,0,0)
  442. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0.2,0)
  443. ArmWeld.C0 = ArmWeld.C0 * CFrame.new(0,0,-0.1) * CFrame.Angles(math.pi/5/2/2,0,0)
  444. WeldA.C0 = WeldA.C0 * CFrame.Angles(0.2,0,0)
  445. end
  446. for i = 1,10 do wait()
  447. ArmWeldR.C0 = ArmWeldR.C0 * CFrame.Angles(-math.pi/8/2/2/2,0,0)
  448. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0.1,0)
  449. ArmWeld.C0 = ArmWeld.C0 * CFrame.Angles(-math.pi/10/2/2,0,0) * CFrame.new(0,0,0.05)
  450. WeldA.C0 = WeldA.C0 * CFrame.Angles(-0.1,0,0)
  451. end
  452. NewSound("http://www.roblox.com/Asset/?id=10209881",10,1,Handle)
  453. for i = 1,5 do wait()
  454. ArmWeldR.C0 = ArmWeldR.C0 - Vector3.new(0,0,0.2)
  455. end
  456. Ammo = Ammo - 1 TName()
  457. wait(0.1)
  458. for i = 1,5 do wait()
  459. ArmWeldR.C0 = ArmWeldR.C0 + Vector3.new(0,0,0.2)
  460. end
  461. end
  462. end
  463.  
  464. --[[ * Sound * ]]--
  465.  
  466. function NewSound(ID,V,P,N)
  467. coroutine.resume(coroutine.create(function()
  468. local SoundD = Instance.new("Sound")
  469. SoundD.SoundId = ID
  470. SoundD.Volume = V
  471. SoundD.Pitch = P
  472. SoundD.Parent = N
  473. SoundD:Play()
  474. while SoundD.IsPlaying do wait() end
  475. SoundD:Remove()
  476. end))
  477. end
  478.  
  479. function NewSoundI(ID,V,P,N,I)
  480. coroutine.resume(coroutine.create(function()
  481. local SoundD = Instance.new("Sound")
  482. SoundD.SoundId = ID
  483. SoundD.Volume = V
  484. SoundD.Pitch = P
  485. SoundD.Parent = N
  486. SoundD:Play()
  487. wait(I)
  488. SoundD:Stop()
  489. wait()
  490. SoundD:Remove()
  491. end))
  492. end
  493.  
  494. --[[ * Tool * ]]--
  495.  
  496. if script.Parent.Name == Player.Name then
  497. Hopper = Instance.new("HopperBin")
  498. Hopper.Name = "Gun"
  499. Hopper.Parent = Player.Backpack
  500. end
  501.  
  502. Blah = true
  503. ABC = BarrelA.CFrame
  504.  
  505. function Clicked(Mouse)
  506. if Blah == true then
  507. Blah = false
  508. if Ammo == 0 then
  509. Reload()
  510. else
  511. if Head == true then Character.Head:BreakJoints() return end
  512. coroutine.resume(coroutine.create(function()
  513. Mouse.Target:BreakJoints()
  514. end))
  515. Shoot()
  516. end
  517. Blah = true
  518. return
  519. end
  520. end
  521.  
  522. function onKeyDown(key)
  523. if Blah == true then
  524. Blah = false
  525.  
  526. if key == "p" then
  527. NewSound("",10,0.5,Handle)
  528. end
  529.  
  530. if key == "0" or key == "/" then
  531. if not Head then
  532. if Arms == false then
  533. ArmsOn()
  534. Arms = true
  535. elseif Arms == true then
  536. ArmsOff()
  537. Arms = false
  538. end
  539. end
  540. end
  541.  
  542. if key == "" then
  543. if not Head then
  544. if Arms then ArmsOff() Arms = false end
  545. SuicideYes()
  546. Head = true
  547. elseif Head then
  548. SuicideNo()
  549. if Arms then ArmsOn() end
  550. Head = false
  551. end
  552. end
  553.  
  554. if key == "r" then
  555. Reload()
  556. end
  557.  
  558. Blah = true
  559. return
  560. end
  561. end
  562.  
  563. function Selected(Mouse)
  564. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  565. Mouse.KeyDown:connect(onKeyDown)
  566. Mouse.Button1Down:connect(function()Clicked(Mouse)end)
  567. TName()
  568. if Blah then
  569. Blah = false
  570. if not Arms then
  571. ArmsOn()
  572. Arms = true
  573. end
  574. Blah = true
  575. end
  576. end
  577.  
  578. function Deselected(Mouse)
  579. if Blah then
  580. Blah = false
  581. if Arms then
  582. ArmsOff()
  583. Arms = false
  584. end
  585. Blah = true
  586. end
  587. end
  588.  
  589. function Dead()
  590. for i,v in pairs(Character:GetChildren()) do
  591. pcall(function() v.Anchored = true end)
  592. if v.Name == "Head" then v.Anchored = false v.Velocity = Vector3.new(10,0,10) end
  593. for i,a in pairs(v:GetChildren()) do pcall(function() a.Anchored = true end) end
  594. end
  595. end
  596.  
  597. Character.Humanoid.Died:connect(Dead)
  598. Hopper.Selected:connect(Selected)
  599. Hopper.Deselected:connect(Deselected)
Add Comment
Please, Sign In to add comment