Advertisement
tallzack145

MP412 (non local)

Sep 20th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 102.30 KB | None | 0 0
  1. --MP412 Gifted by TheRedAngel, Regular Script!
  2. if script == nil then return end
  3. Player = game.Players.YOURNAMEHERE
  4. Name = "MP412"
  5. MC = BrickColor.new("Really black")
  6. GC = BrickColor.new("Really black")
  7. Spread = 90000
  8. MR = 0.15
  9. Chamber = 1
  10. Loaded = 0
  11. Scoped = false
  12. Scoped = false
  13. selected = false
  14. Hammer = true
  15. canDual = false
  16. dual = true
  17. Button1Down = false
  18. damage = 10
  19. canFire = false
  20. canFire2 = true
  21. readyTime = 0.000023
  22. automatic = false
  23. burst = false
  24. burstCount = 0
  25. burstCountMax = 3
  26. canSilence = false
  27. silenced = false
  28. canZoom = true
  29. zoom = false
  30. switchToSingle = true
  31. switchToBurst = true
  32. switchToAutomatic = true
  33. ammoGui = Instance.new("ScreenGui")
  34. ammoGui.Name = Name
  35. local frame = Instance.new("Frame")
  36. frame.Name = "Frame"
  37. frame.Size = UDim2.new(0, 165, 0, 60)
  38. frame.Position = UDim2.new(0, 0, 1, -400)
  39. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  40. frame.BorderColor3 = Color3.new(0, 0, 0)
  41. frame.Parent = ammoGui
  42. local label = Instance.new("TextLabel")
  43. label.Name = "Weapon"
  44. label.Text = "Weapon: " ..Name
  45. label.Size = UDim2.new(1, 0, 0, 20)
  46. label.Position = UDim2.new(0, 0, 0, 0)
  47. label.BackgroundColor3 = Color3.new(1, 0, 0)
  48. label.BorderColor3 = Color3.new(0, 0, 0)
  49. label.Parent = frame
  50. local label = Instance.new("TextLabel")
  51. label.Name = "MagazinePrefix"
  52. label.Text = " Magazine:"
  53. label.TextXAlignment = "Left"
  54. label.Size = UDim2.new(1, 0, 0, 20)
  55. label.Position = UDim2.new(0, 0, 0, 20)
  56. label.BackgroundColor3 = Color3.new(1, 1, 1)
  57. label.BorderColor3 = Color3.new(0, 0, 0)
  58. label.Parent = frame
  59. local label = Instance.new("TextLabel")
  60. label.Name = "Magazine"
  61. label.Text = "0/0"
  62. label.TextXAlignment = "Right"
  63. label.Size = UDim2.new(1, 0, 0, 20)
  64. label.Position = UDim2.new(0, -10, 0, 20)
  65. label.BackgroundTransparency = 1
  66. label.BorderSizePixel = 0
  67. label.Parent = frame
  68. local label = Instance.new("TextLabel")
  69. label.Name = "AmmoPrefix"
  70. label.Text = " .357 Magnum:"
  71. label.TextXAlignment = "Left"
  72. label.Size = UDim2.new(1, 0, 0, 20)
  73. label.Position = UDim2.new(0, 0, 0, 40)
  74. label.BackgroundColor3 = Color3.new(1, 1, 1)
  75. label.BorderColor3 = Color3.new(0, 0, 0)
  76. label.Parent = frame
  77. local label = Instance.new("TextLabel")
  78. label.Name = "Ammo"
  79. label.Text = "0/0"
  80. label.TextXAlignment = "Right"
  81. label.Size = UDim2.new(1, 0, 0, 20)
  82. label.Position = UDim2.new(0, -10, 0, 40)
  83. label.BackgroundTransparency = 1
  84. label.BorderSizePixel = 0
  85. label.Parent = frame
  86. function updateGui()
  87. if selected == false then return end
  88. if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
  89. if Player.PlayerGui:FindFirstChild(Name) == nil then
  90. ammoGui:Clone().Parent = Player.PlayerGui
  91. end
  92. Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
  93. Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
  94. end
  95. function makeParts(format)
  96. local model = Instance.new("Model")
  97. model.Name = Name
  98. local pm = Instance.new("Part")
  99. pm.Name = "Handle"
  100. pm.formFactor = "Symmetric"
  101. pm.Size = Vector3.new(1, 1, 1)
  102. pm.BrickColor = MC
  103. pm.Reflectance = MR
  104. pm.Transparency = 1
  105. pm.CanCollide = false
  106. pm.Locked = true
  107. pm.TopSurface = 0
  108. pm.BottomSurface = 0
  109. pm.Parent = model
  110. local m = Instance.new("SpecialMesh")
  111. m.MeshType = "Brick"
  112. m.Scale = Vector3.new(0.3, 0.8, 0.4)
  113. m.Parent = pm
  114. if format ~= nil then
  115. local w = Instance.new("Weld")
  116. w.Part0 = pm
  117. if format == "RightHand" then
  118. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  119. w.C0 = CFrame.new(0, 0.9, 0.68)
  120. w.C1 = CFrame.new()
  121. elseif format == "LeftHand" then
  122. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  123. w.C0 = CFrame.new(0, 0.9, 0.68)
  124. w.C1 = CFrame.new()
  125. model.Name = Name.. " (Left)"
  126. elseif format == "RightHolster" then
  127. w.Part1 = Player.Character:FindFirstChild("Right Leg")
  128. w.C0 = CFrame.new(-0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
  129. w.C1 = CFrame.new()
  130. w.Parent = pm
  131. model.Name = Name.. " (Holstered)"
  132. elseif format == "LeftHolster" then
  133. w.Part1 = Player.Character:FindFirstChild("Left Leg")
  134. w.C0 = CFrame.new(0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
  135. w.C1 = CFrame.new()
  136. model.Name = Name.. " (Holstered, Left)"
  137. end
  138. w.Parent = pm
  139. model.Parent = Player.Character
  140. end
  141. local s = Instance.new("Sound")
  142. s.Name = "Fire"
  143. s.SoundId = "http://www.roblox.com/Asset/?id=10209875"
  144. s.Volume = .5
  145. s.Pitch = 50
  146. s.Looped = false
  147. s.Parent = pm
  148. local s = Instance.new("Sound")
  149. s.Name = "Reload"
  150. s.SoundId = "http://www.roblox.com/Asset/?id=10209894"
  151. s.Volume = 0.8
  152. s.Pitch = 4
  153. s.Looped = false
  154. s.Parent = pm
  155. local s = Instance.new("Sound")
  156. s.Name = "Empty"
  157. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  158. s.Volume = 1
  159. s.Pitch = 5
  160. s.Looped = false
  161. s.Parent = pm
  162. local s = Instance.new("Sound")
  163. s.Name = "Lock"
  164. s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
  165. s.Volume = 1
  166. s.Pitch = 3
  167. s.Looped = false
  168. s.Parent = pm
  169. local s = Instance.new("Sound")
  170. s.Name = "Release"
  171. s.SoundId = "http://www.roblox.com/Asset/?id=10209813"
  172. s.Volume = 1
  173. s.Pitch = 4
  174. s.Looped = false
  175. s.Parent = pm
  176. local s = Instance.new("Sound")
  177. s.Name = "Switch"
  178. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  179. s.Volume = 1
  180. s.Pitch = 10
  181. s.Looped = false
  182. s.Parent = pm
  183. local p = Instance.new("Part")
  184. p.Name = "ShellOut"
  185. p.formFactor = "Symmetric"
  186. p.Size = Vector3.new(1, 1, 1)
  187. p.Transparency = 1
  188. p.Locked = true
  189. p.CanCollide = false
  190. p.TopSurface = 0
  191. p.BottomSurface = 0
  192. p.Parent = model
  193. local w = Instance.new("Weld")
  194. w.Part0 = p
  195. w.Part1 = pm
  196. w.C0 = CFrame.new(0.5, 0, 0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0)
  197. w.C1 = CFrame.new()
  198. w.Parent = p
  199. local p = Instance.new("Part")
  200. p.Name = "Grip"
  201. p.formFactor = "Symmetric"
  202. p.Size = Vector3.new(1, 1, 1)
  203. p.BrickColor = GC
  204. p.CanCollide = false
  205. p.Locked = true
  206. p.TopSurface = 0
  207. p.BottomSurface = 0
  208. p.Parent = model
  209. local m = Instance.new("BlockMesh")
  210. m.Scale = Vector3.new(0.261, 0.42, 0.7)
  211. m.Parent = p
  212. local w = Instance.new("Weld")
  213. w.Part0 = p
  214. w.Part1 = pm
  215. w.C0 = CFrame.new(0, -0.022, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  216. w.C1 = CFrame.new()
  217. w.Parent = p
  218. local p = Instance.new("Part")
  219. p.Name = "TriggerGuard"
  220. p.formFactor = "Symmetric"
  221. p.Size = Vector3.new(1, 1, 1)
  222. p.BrickColor = GC
  223. p.CanCollide = false
  224. p.Locked = true
  225. p.TopSurface = 0
  226. p.BottomSurface = 0
  227. p.Parent = model
  228. local m = Instance.new("SpecialMesh")
  229. m.MeshType = "FileMesh"
  230. m.MeshId = "http://www.roblox.com/asset/?id=3270017"
  231. m.Scale = Vector3.new(0.3, 0.3, 0.8)
  232. m.Parent = p
  233. local w = Instance.new("Weld")
  234. w.Part0 = p
  235. w.Part1 = pm
  236. w.C0 = CFrame.new(-0.21, 0.16, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  237. w.C1 = CFrame.new()
  238. w.Parent = p
  239. local p = Instance.new("Part")
  240. p.Name = "Trigger"
  241. p.formFactor = "Symmetric"
  242. p.Size = Vector3.new(1, 1, 1)
  243. p.BrickColor = GC
  244. p.CanCollide = false
  245. p.Locked = true
  246. p.TopSurface = 0
  247. p.BottomSurface = 0
  248. p.Parent = model
  249. local m = Instance.new("BlockMesh")
  250. m.Scale = Vector3.new(0.1, 0.4, 0.16)
  251. m.Parent = p
  252. local w = Instance.new("Weld")
  253. w.Part0 = p
  254. w.Part1 = pm
  255. w.C0 = CFrame.new(0, 0.04, -0.22)
  256. w.C1 = CFrame.new()
  257. w.Parent = p
  258. local p = Instance.new("Part")
  259. p.Name = "Base"
  260. p.CanCollide = false
  261. p.formFactor = "Symmetric"
  262. p.Size = Vector3.new(1, 1, 1)
  263. p.BrickColor = GC
  264. p.Locked = true
  265. p.TopSurface = 0
  266. p.BottomSurface = 0
  267. p.Parent = model
  268. local m = Instance.new("BlockMesh")
  269. m.Scale = Vector3.new(0.26, 0.72, 0.1)
  270. m.Parent = p
  271. local w = Instance.new("Weld")
  272. w.Part0 = p
  273. w.Part1 = pm
  274. w.C0 = CFrame.new(0, 0.09, -0.1)
  275. w.C1 = CFrame.new()
  276. w.Parent = p
  277. local p = Instance.new("Part")
  278. p.Name = "Body"
  279. p.formFactor = "Symmetric"
  280. p.Size = Vector3.new(1, 1, 1)
  281. p.BrickColor = GC
  282. p.CanCollide = false
  283. p.Locked = true
  284. p.TopSurface = 0
  285. p.BottomSurface = 0
  286. p.Parent = model
  287. local m = Instance.new("BlockMesh")
  288. m.Scale = Vector3.new(0.26, 0.1, 0.28)
  289. m.Parent = p
  290. local w = Instance.new("Weld")
  291. w.Part0 = p
  292. w.Part1 = pm
  293. w.C0 = CFrame.new(0, 0, 0.03)
  294. w.C1 = CFrame.new()
  295. w.Parent = p
  296. local p = Instance.new("Part")
  297. p.Name = "Body"
  298. p.formFactor = "Symmetric"
  299. p.Size = Vector3.new(1, 1, 1)
  300. p.BrickColor = GC
  301. p.CanCollide = false
  302. p.Locked = true
  303. p.TopSurface = 0
  304. p.BottomSurface = 0
  305. p.Parent = model
  306. local m = Instance.new("SpecialMesh")
  307. m.MeshType = "Wedge"
  308. m.Scale = Vector3.new(0.086, 0.2, 0.15)
  309. m.Parent = p
  310. local w = Instance.new("Weld")
  311. w.Part0 = p
  312. w.Part1 = pm
  313. w.C0 = CFrame.new(0.086, -0.15, 0.08)
  314. w.C1 = CFrame.new()
  315. w.Parent = p
  316. local p = Instance.new("Part")
  317. p.Name = "Body"
  318. p.formFactor = "Symmetric"
  319. p.Size = Vector3.new(1, 1, 1)
  320. p.BrickColor = GC
  321. p.CanCollide = false
  322. p.Locked = true
  323. p.TopSurface = 0
  324. p.BottomSurface = 0
  325. p.Parent = model
  326. local m = Instance.new("SpecialMesh")
  327. m.MeshType = "Wedge"
  328. m.Scale = Vector3.new(0.086, 0.2, 0.15)
  329. m.Parent = p
  330. local w = Instance.new("Weld")
  331. w.Part0 = p
  332. w.Part1 = pm
  333. w.C0 = CFrame.new(-0.086, -0.15, 0.08)
  334. w.C1 = CFrame.new()
  335. w.Parent = p
  336. local p = Instance.new("Part")
  337. p.Name = "Body"
  338. p.formFactor = "Symmetric"
  339. p.Size = Vector3.new(1, 1, 1)
  340. p.BrickColor = GC
  341. p.CanCollide = false
  342. p.Locked = true
  343. p.TopSurface = 0
  344. p.BottomSurface = 0
  345. p.Parent = model
  346. local m = Instance.new("SpecialMesh")
  347. m.MeshType = "Wedge"
  348. m.Scale = Vector3.new(0.086, 0.2, 0.075)
  349. m.Parent = p
  350. local w = Instance.new("Weld")
  351. w.Part0 = p
  352. w.Part1 = pm
  353. w.C0 = CFrame.new(0, -0.15, 0.02)
  354. w.C1 = CFrame.new()
  355. w.Parent = p
  356. local p = Instance.new("Part")
  357. p.Name = "Hammer"
  358. p.formFactor = "Symmetric"
  359. p.Size = Vector3.new(1, 1, 1)
  360. p.BrickColor = MC
  361. p.Reflectance = MR
  362. p.CanCollide = false
  363. p.Locked = true
  364. p.TopSurface = 0
  365. p.BottomSurface = 0
  366. p.Parent = model
  367. local m = Instance.new("BlockMesh")
  368. m.Scale = Vector3.new(0.086, 0.1, 0.3)
  369. m.Parent = p
  370. local w = Instance.new("Weld")
  371. w.Part0 = p
  372. w.Part1 = pm
  373. if Hammer == false then
  374. w.C0 = CFrame.new(0, -0.1, 0.08)
  375. else
  376. w.C0 = CFrame.new(0, -0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-35), 0, 0)
  377. end
  378. w.C1 = CFrame.new()
  379. w.Parent = p
  380. local p = Instance.new("Part")
  381. p.Name = "Body"
  382. p.formFactor = "Symmetric"
  383. p.Size = Vector3.new(1, 1, 1)
  384. p.BrickColor = GC
  385. p.CanCollide = false
  386. p.Locked = true
  387. p.TopSurface = 0
  388. p.BottomSurface = 0
  389. p.Parent = model
  390. local m = Instance.new("BlockMesh")
  391. m.Scale = Vector3.new(0.26, 0.22, 0.1)
  392. m.Parent = p
  393. local w = Instance.new("Weld")
  394. w.Part0 = p
  395. w.Part1 = pm
  396. w.C0 = CFrame.new(0, -0.16, -0.02)
  397. w.C1 = CFrame.new()
  398. w.Parent = p
  399. local pv1 = Instance.new("Part")
  400. pv1.Name = "Pivot1"
  401. pv1.formFactor = "Symmetric"
  402. pv1.Size = Vector3.new(1, 1, 1)
  403. pv1.BrickColor = MC
  404. pv1.Reflectance = MR
  405. pv1.CanCollide = false
  406. pv1.Locked = true
  407. pv1.TopSurface = 0
  408. pv1.BottomSurface = 0
  409. pv1.Parent = model
  410. local m = Instance.new("CylinderMesh")
  411. m.Scale = Vector3.new(0.15, 0.261, 0.15)
  412. m.Parent = pv1
  413. local w = Instance.new("Weld")
  414. w.Part0 = pv1
  415. w.Part1 = pm
  416. w.C0 = CFrame.new(-0.45, 0, -0.04) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  417. w.C1 = CFrame.new()
  418. w.Parent = pv1
  419. local pv = Instance.new("Part")
  420. pv.Name = "Pivot"
  421. pv.formFactor = "Symmetric"
  422. pv.Size = Vector3.new(1, 1, 1)
  423. pv.BrickColor = BrickColor.new("Really black")
  424. pv.Reflectance = MR
  425. pv.CanCollide = false
  426. pv.Locked = true
  427. pv.TopSurface = 0
  428. pv.BottomSurface = 0
  429. pv.Parent = model
  430. local m = Instance.new("CylinderMesh")
  431. m.Scale = Vector3.new(0.1, 0.27, 0.1)
  432. m.Parent = pv
  433. local w = Instance.new("Weld")
  434. w.Part0 = pv
  435. w.Part1 = pv1
  436. w.C0 = CFrame.new(0, 0, 0)
  437. w.C1 = CFrame.new()
  438. w.Parent = pv
  439. local p = Instance.new("Part")
  440. p.Name = "Barrel1"
  441. p.formFactor = "Symmetric"
  442. p.Size = Vector3.new(1, 1, 1)
  443. p.BrickColor = MC
  444. p.Reflectance = MR
  445. p.CanCollide = false
  446. p.Locked = true
  447. p.TopSurface = 0
  448. p.BottomSurface = 0
  449. p.Parent = model
  450. local m = Instance.new("BlockMesh")
  451. m.Scale = Vector3.new(0.15, 0.26, 0.28)
  452. m.Parent = p
  453. local w = Instance.new("Weld")
  454. w.Part0 = p
  455. w.Part1 = pv
  456. w.C0 = CFrame.new(0, 0, 0.14)
  457. w.C1 = CFrame.new()
  458. w.Parent = p
  459. local p = Instance.new("Part")
  460. p.Name = "Barrel2"
  461. p.formFactor = "Symmetric"
  462. p.Size = Vector3.new(1, 1, 1)
  463. p.BrickColor = MC
  464. p.Reflectance = MR
  465. p.CanCollide = false
  466. p.Locked = true
  467. p.TopSurface = 0
  468. p.BottomSurface = 0
  469. p.Parent = model
  470. local m = Instance.new("BlockMesh")
  471. m.Scale = Vector3.new(0.6, 0.2, 0.28)
  472. m.Parent = p
  473. local w = Instance.new("Weld")
  474. w.Part0 = p
  475. w.Part1 = pv
  476. w.C0 = CFrame.new(-0.36, 0, 0.14)
  477. w.C1 = CFrame.new()
  478. w.Parent = p
  479. local p = Instance.new("Part")
  480. p.Name = "Barrel3"
  481. p.formFactor = "Symmetric"
  482. p.Size = Vector3.new(1, 1, 1)
  483. p.BrickColor = MC
  484. p.Reflectance = MR
  485. p.CanCollide = false
  486. p.Locked = true
  487. p.TopSurface = 0
  488. p.BottomSurface = 0
  489. p.Parent = model
  490. local m = Instance.new("BlockMesh")
  491. m.Scale = Vector3.new(0.6, 0.26, 0.22)
  492. m.Parent = p
  493. local w = Instance.new("Weld")
  494. w.Part0 = p
  495. w.Part1 = pv
  496. w.C0 = CFrame.new(-0.36, 0, 0.14)
  497. w.C1 = CFrame.new()
  498. w.Parent = p
  499. local p = Instance.new("Part")
  500. p.Name = "Hole"
  501. p.formFactor = "Symmetric"
  502. p.Size = Vector3.new(1, 1, 1)
  503. p.BrickColor = BrickColor.new("New Yeller")
  504. p.Reflectance = 0
  505. p.CanCollide = false
  506. p.Locked = true
  507. p.TopSurface = 0
  508. p.BottomSurface = 0
  509. p.Parent = model
  510. local m = Instance.new("CylinderMesh")
  511. m.Scale = Vector3.new(0.1, 0.602, 0.1)
  512. m.Parent = p
  513. local w = Instance.new("Weld")
  514. w.Part0 = p
  515. w.Part1 = pv
  516. w.C0 = CFrame.new(0, -0.36, 0.18) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  517. w.C1 = CFrame.new()
  518. w.Parent = p
  519. local p = Instance.new("Part")
  520. p.Name = "Top"
  521. p.formFactor = "Symmetric"
  522. p.Size = Vector3.new(1, 1, 1)
  523. p.BrickColor = MC
  524. p.Reflectance = MR
  525. p.CanCollide = false
  526. p.Locked = true
  527. p.TopSurface = 0
  528. p.BottomSurface = 0
  529. p.Parent = model
  530. local m = Instance.new("BlockMesh")
  531. m.Scale = Vector3.new(0.5, 0.26, 0.08)
  532. m.Parent = p
  533. local w = Instance.new("Weld")
  534. w.Part0 = p
  535. w.Part1 = pv
  536. w.C0 = CFrame.new(0.25, 0, 0.24)
  537. w.C1 = CFrame.new()
  538. w.Parent = p
  539. if Scoped == true then
  540. canZoom = true
  541. local p = Instance.new("Part")
  542. p.Name = "Scope"
  543. p.formFactor = "Symmetric"
  544. p.Size = Vector3.new(1, 1, 1)
  545. p.BrickColor = GC
  546. p.CanCollide = false
  547. p.Locked = true
  548. p.TopSurface = 0
  549. p.BottomSurface = 0
  550. p.Parent = model
  551. local m = Instance.new("CylinderMesh")
  552. m.Scale = Vector3.new(0.24, 0.5, 0.24)
  553. m.Parent = p
  554. local w = Instance.new("Weld")
  555. w.Part0 = p
  556. w.Part1 = pv
  557. w.C0 = CFrame.new(0, -0.2, 0.38) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  558. w.C1 = CFrame.new()
  559. w.Parent = p
  560. local p = Instance.new("Part")
  561. p.Name = "Scope"
  562. p.formFactor = "Symmetric"
  563. p.Size = Vector3.new(1, 1, 1)
  564. p.BrickColor = BrickColor.new("White")
  565. p.Reflectance = 0.5
  566. p.CanCollide = false
  567. p.Locked = true
  568. p.TopSurface = 0
  569. p.BottomSurface = 0
  570. p.Parent = model
  571. local m = Instance.new("CylinderMesh")
  572. m.Scale = Vector3.new(0.23, 0.503, 0.23)
  573. m.Parent = p
  574. local w = Instance.new("Weld")
  575. w.Part0 = p
  576. w.Part1 = pv
  577. w.C0 = CFrame.new(0, -0.2, 0.38) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  578. w.C1 = CFrame.new()
  579. w.Parent = p
  580. else end
  581. local p = Instance.new("Part")
  582. p.Name = "RearSight"
  583. p.formFactor = "Symmetric"
  584. p.Size = Vector3.new(1, 1, 1)
  585. p.BrickColor = MC
  586. p.Reflectance = MR
  587. p.CanCollide = false
  588. p.Locked = true
  589. p.TopSurface = 0
  590. p.BottomSurface = 0
  591. p.Parent = model
  592. local m = Instance.new("BlockMesh")
  593. m.Scale = Vector3.new(0.1, 0.08, 0.08)
  594. m.Parent = p
  595. local w = Instance.new("Weld")
  596. w.Part0 = p
  597. w.Part1 = pv
  598. w.C0 = CFrame.new(0.44, 0.08, 0.28)
  599. w.C1 = CFrame.new()
  600. w.Parent = p
  601. local p = Instance.new("Part")
  602. p.Name = "RearSight"
  603. p.formFactor = "Symmetric"
  604. p.Size = Vector3.new(1, 1, 1)
  605. p.BrickColor = MC
  606. p.Reflectance = MR
  607. p.CanCollide = false
  608. p.Locked = true
  609. p.TopSurface = 0
  610. p.BottomSurface = 0
  611. p.Parent = model
  612. local m = Instance.new("BlockMesh")
  613. m.Scale = Vector3.new(0.1, 0.08, 0.08)
  614. m.Parent = p
  615. local w = Instance.new("Weld")
  616. w.Part0 = p
  617. w.Part1 = pv
  618. w.C0 = CFrame.new(0.44, -0.08, 0.28)
  619. w.C1 = CFrame.new()
  620. w.Parent = p
  621. local p = Instance.new("Part")
  622. p.Name = "FrontSight"
  623. p.formFactor = "Symmetric"
  624. p.Size = Vector3.new(1, 1, 1)
  625. p.BrickColor = MC
  626. p.Reflectance = MR
  627. p.CanCollide = false
  628. p.Locked = true
  629. p.TopSurface = 0
  630. p.BottomSurface = 0
  631. p.Parent = model
  632. local m = Instance.new("BlockMesh")
  633. m.Scale = Vector3.new(0.1, 0.08, 0.08)
  634. m.Parent = p
  635. local w = Instance.new("Weld")
  636. w.Part0 = p
  637. w.Part1 = pv
  638. w.C0 = CFrame.new(-0.58, 0, 0.28)
  639. w.C1 = CFrame.new()
  640. w.Parent = p
  641. local p = Instance.new("Part")
  642. p.Name = "Cylinder"
  643. p.formFactor = "Symmetric"
  644. p.Size = Vector3.new(1, 1, 1)
  645. p.BrickColor = MC
  646. p.Reflectance = MR
  647. p.CanCollide = false
  648. p.Locked = true
  649. p.TopSurface = 0
  650. p.BottomSurface = 0
  651. p.Parent = model
  652. local m = Instance.new("CylinderMesh")
  653. m.Scale = Vector3.new(0.29, 0.32, 0.29)
  654. m.Parent = p
  655. local w = Instance.new("Weld")
  656. w.Part0 = p
  657. w.Part1 = pv
  658. w.C0 = CFrame.new(0, 0.23, 0.1) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  659. w.C1 = CFrame.new()
  660. w.Parent = p
  661. local p = Instance.new("Part")
  662. p.Name = "Pin"
  663. p.formFactor = "Symmetric"
  664. p.Size = Vector3.new(1, 1, 1)
  665. p.BrickColor = BrickColor.new("New Yeller")
  666. p.Reflectance = MR
  667. p.CanCollide = false
  668. p.Locked = true
  669. p.TopSurface = 0
  670. p.BottomSurface = 0
  671. p.Parent = model
  672. local m = Instance.new("CylinderMesh")
  673. m.Scale = Vector3.new(0.06, 0.46, 0.06)
  674. m.Parent = p
  675. local w = Instance.new("Weld")
  676. w.Part0 = p
  677. w.Part1 = pv
  678. w.C0 = CFrame.new(0, 0.23, 0.1) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  679. w.C1 = CFrame.new()
  680. w.Parent = p
  681. local p = Instance.new("Part")
  682. if silenced == false then
  683. p.Name = "Muzzle"
  684. else
  685. p.Name = "Muzzle 2"
  686. end
  687. p.formFactor = "Symmetric"
  688. p.Size = Vector3.new(1, 1, 1)
  689. p.BrickColor = BrickColor.new("Really black")
  690. p.Reflectance = 0.06
  691. p.CanCollide = false
  692. p.Transparency = 1
  693. p.Locked = true
  694. p.TopSurface = 0
  695. p.BottomSurface = 0
  696. p.Parent = model
  697. local m = Instance.new("CylinderMesh")
  698. m.Scale = Vector3.new(0.5, 0.1, 0.5)
  699. m.Offset = Vector3.new(0, 0, 0)
  700. m.Parent = p
  701. local w = Instance.new("Weld")
  702. w.Part0 = p
  703. w.Part1 = pv
  704. w.C0 = CFrame.new(0, 0.8, 0.18) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-90))
  705. w.C1 = CFrame.new()
  706. w.Parent = p
  707. local s = Instance.new("Smoke")
  708. s.Enabled = false
  709. s.Name = "Smoke"
  710. s.RiseVelocity = -5
  711. s.Opacity = 0.3
  712. s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
  713. s.Size = 1
  714. s.Parent = p
  715. local f = Instance.new("Fire")
  716. f.Enabled = false
  717. f.Name = "Fire"
  718. f.Heat = -35
  719. f.Size = 1
  720. f.Parent = p
  721. return model
  722. end
  723. function removeParts(format)
  724. if format == "RightHand" then
  725. pcall(function() Player.Character[Name]:Remove() end)
  726. elseif format == "LeftHand" then
  727. pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
  728. elseif format == "RightHolster" then
  729. pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
  730. elseif format == "LeftHolster" then
  731. pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
  732. end
  733. end
  734. function SetAngle(Joint, Angle, Character)
  735. if Character == nil then return false end
  736. local Joints = {
  737. Character.Torso:FindFirstChild("Right Shoulder 2"),
  738. Character.Torso:FindFirstChild("Left Shoulder 2"),
  739. Character.Torso:FindFirstChild("Right Hip 2"),
  740. Character.Torso:FindFirstChild("Left Hip 2")
  741. }
  742. if Joints[Joint] == nil then return false end
  743. if Joint == 1 or Joint == 3 then
  744. Joints[Joint].DesiredAngle = Angle
  745. end
  746. if Joint == 2 or Joint == 4 then
  747. Joints[Joint].DesiredAngle = -Angle
  748. end
  749. end
  750. function ForceAngle(Joint, Angle, Character)
  751. if Character == nil then return false end
  752. local Joints = {
  753. Character.Torso:FindFirstChild("Right Shoulder 2"),
  754. Character.Torso:FindFirstChild("Left Shoulder 2"),
  755. Character.Torso:FindFirstChild("Right Hip 2"),
  756. Character.Torso:FindFirstChild("Left Hip 2")
  757. }
  758. if Joints[Joint] == nil then return false end
  759. if Joint == 1 or Joint == 3 then
  760. Joints[Joint].DesiredAngle = Angle
  761. Joints[Joint].CurrentAngle = Angle
  762. end
  763. if Joint == 2 or Joint == 4 then
  764. Joints[Joint].DesiredAngle = -Angle
  765. Joints[Joint].CurrentAngle = -Angle
  766. end
  767. end
  768. function SetSpeed(Joint, Speed, Character)
  769. if Character == nil then return false end
  770. local Joints = {
  771. Character.Torso:FindFirstChild("Right Shoulder 2"),
  772. Character.Torso:FindFirstChild("Left Shoulder 2"),
  773. Character.Torso:FindFirstChild("Right Hip 2"),
  774. Character.Torso:FindFirstChild("Left Hip 2")
  775. }
  776. if Joints[Joint] == nil then return false end
  777. Joints[Joint].MaxVelocity = Speed
  778. end
  779. function DisableLimb(Limb, Character)
  780. if Character == nil then return false end
  781. if Character:FindFirstChild("Torso") == nil then return false end
  782. local Joints = {
  783. Character.Torso:FindFirstChild("Right Shoulder"),
  784. Character.Torso:FindFirstChild("Left Shoulder"),
  785. Character.Torso:FindFirstChild("Right Hip"),
  786. Character.Torso:FindFirstChild("Left Hip")
  787. }
  788. local Limbs = {
  789. Character:FindFirstChild("Right Arm"),
  790. Character:FindFirstChild("Left Arm"),
  791. Character:FindFirstChild("Right Leg"),
  792. Character:FindFirstChild("Left Leg")
  793. }
  794. if Joints[Limb] == nil then return false end
  795. if Limbs[Limb] == nil then return false end
  796. local Joint = Instance.new("Motor")
  797. Joint.Parent = Character.Torso
  798. Joint.Part0 = Character.Torso
  799. Joint.Part1 = Limbs[Limb]
  800. if Limb == 1 then
  801. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  802. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  803. Joint.Name = "Right Shoulder 2"
  804. elseif Limb == 2 then
  805. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  806. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  807. Joint.Name = "Left Shoulder 2"
  808. elseif Limb == 3 then
  809. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  810. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  811. Joint.Name = "Right Hip 2"
  812. elseif Limb == 4 then
  813. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  814. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  815. Joint.Name = "Left Hip 2"
  816. end
  817. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  818. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  819. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  820. Joints[Limb]:Remove()
  821. end
  822. function ResetLimbCFrame(Limb, Character)
  823. if Character == nil then return false end
  824. if Character.Parent == nil then return false end
  825. if Character:FindFirstChild("Torso") == nil then return false end
  826. local Joints = {
  827. Character.Torso:FindFirstChild("Right Shoulder 2"),
  828. Character.Torso:FindFirstChild("Left Shoulder 2"),
  829. Character.Torso:FindFirstChild("Right Hip 2"),
  830. Character.Torso:FindFirstChild("Left Hip 2")
  831. }
  832. local Limbs = {
  833. Character:FindFirstChild("Right Arm"),
  834. Character:FindFirstChild("Left Arm"),
  835. Character:FindFirstChild("Right Leg"),
  836. Character:FindFirstChild("Left Leg")
  837. }
  838. if Joints[Limb] == nil then return false end
  839. if Limbs[Limb] == nil then return false end
  840. if Limb == 1 then
  841. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  842. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  843. elseif Limb == 2 then
  844. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  845. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  846. elseif Limb == 3 then
  847. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  848. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  849. elseif Limb == 4 then
  850. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  851. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  852. end
  853. end
  854. function EnableLimb(Limb, Character)
  855. if Character == nil then return false end
  856. if Character:FindFirstChild("Torso") == nil then return false end
  857. local Joints = {
  858. Character.Torso:FindFirstChild("Right Shoulder 2"),
  859. Character.Torso:FindFirstChild("Left Shoulder 2"),
  860. Character.Torso:FindFirstChild("Right Hip 2"),
  861. Character.Torso:FindFirstChild("Left Hip 2")
  862. }
  863. local Limbs = {
  864. Character:FindFirstChild("Right Arm"),
  865. Character:FindFirstChild("Left Arm"),
  866. Character:FindFirstChild("Right Leg"),
  867. Character:FindFirstChild("Left Leg")
  868. }
  869. if Joints[Limb] == nil then return false end
  870. if Limbs[Limb] == nil then return false end
  871. if Limb == 1 then
  872. Joints[Limb].Name = "Right Shoulder"
  873. elseif Limb == 2 then
  874. Joints[Limb].Name = "Left Shoulder"
  875. elseif Limb == 3 then
  876. Joints[Limb].Name = "Right Hip"
  877. elseif Limb == 4 then
  878. Joints[Limb].Name = "Left Hip"
  879. end
  880. Animate = Character:FindFirstChild("Animate")
  881. if Animate == nil then return false end
  882. Animate = Animate:Clone()
  883. Character.Animate:Remove()
  884. Animate.Parent = Character
  885. end
  886. function playAnimation(format, mouse)
  887. if format == "equip" then
  888. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  889. local w = Instance.new("Weld")
  890. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  891. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  892. w.C0 = CFrame.new(0, 1.2, 0.7)
  893. w.C1 = CFrame.new()
  894. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  895. for i = 0.01, 1, 0.1 do
  896. if Player.Character:FindFirstChild("Torso") ~= nil then
  897. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  898. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  899. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
  900. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  901. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  902. wait()
  903. else return false end
  904. else return false end
  905. end
  906. return playAnimation("hold")
  907. end
  908. if format == "rightEquip" then
  909. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  910. local w = Instance.new("Weld")
  911. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  912. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  913. w.C0 = CFrame.new(0, 1.2, 0.7)
  914. w.C1 = CFrame.new()
  915. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  916. for i = 0.01, 1, 0.1 do
  917. if Player.Character:FindFirstChild("Torso") ~= nil then
  918. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  919. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  920. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  921. wait()
  922. else return false end
  923. else return false end
  924. end
  925. return playAnimation("rightHold")
  926. end
  927. if format == "leftEquip" then
  928. Player.Character[Name.. " (Holstered, Left)"].Handle.Weld:Remove()
  929. local w = Instance.new("Weld")
  930. w.Part0 = Player.Character[Name.. " (Holstered, Left)"].Handle
  931. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  932. w.C0 = CFrame.new(0, 1.2, 0.7)
  933. w.C1 = CFrame.new()
  934. w.Parent = Player.Character[Name.. " (Holstered, Left)"].Handle
  935. for i = 0.01, 1, 0.1 do
  936. if Player.Character:FindFirstChild("Torso") ~= nil then
  937. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  938. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  939. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0)
  940. wait()
  941. else return false end
  942. else return false end
  943. end
  944. return playAnimation("leftHold")
  945. end
  946. if format == "unequip" then
  947. for i = 1, 0.01, -0.1 do
  948. if Player.Character:FindFirstChild("Torso") ~= nil then
  949. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  950. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  951. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
  952. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  953. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  954. wait()
  955. else return false end
  956. else return false end
  957. end
  958. return true
  959. end
  960. if format == "leftUnequip" then
  961. for i = 1, 0.01, -0.1 do
  962. if Player.Character:FindFirstChild("Torso") ~= nil then
  963. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  964. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  965. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0)
  966. wait()
  967. else return false end
  968. else return false end
  969. end
  970. return true
  971. end
  972. if format == "rightUnequip" then
  973. for i = 1, 0.01, -0.1 do
  974. if Player.Character:FindFirstChild("Torso") ~= nil then
  975. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  976. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  977. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  978. wait()
  979. else return false end
  980. else return false end
  981. end
  982. return true
  983. end
  984. if format == "hold" then
  985. if Player.Character:FindFirstChild("Torso") ~= nil then
  986. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  987. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  988. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  989. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  990. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  991. else return false end
  992. else return false end
  993. end
  994. if format == "rightHold" then
  995. if Player.Character:FindFirstChild("Torso") ~= nil then
  996. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  997. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  998. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(-10))
  999. else return false end
  1000. else return false end
  1001. end
  1002. if format == "leftHold" then
  1003. if Player.Character:FindFirstChild("Torso") ~= nil then
  1004. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1005. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1006. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(10))
  1007. else return false end
  1008. else return false end
  1009. end
  1010. if format == "reload" then
  1011. Player.Character[Name].Handle.Empty:Play()
  1012. for i = 0, 25, 7.5 do
  1013. if Player.Character:FindFirstChild("Torso") ~= nil then
  1014. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1015. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1016. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1017. wait()
  1018. else return false end
  1019. else return false end
  1020. end
  1021. for i = 25, 0, -7.5 do
  1022. if Player.Character:FindFirstChild("Torso") ~= nil then
  1023. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1024. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1025. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1026. wait()
  1027. else return false end
  1028. else return false end
  1029. end
  1030. coroutine.wrap(function()
  1031. for i = 0, 90, 15 do
  1032. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) end)
  1033. wait()
  1034. end
  1035. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) end)
  1036. for i = 1, Loaded do
  1037. Player.Character[Name].Handle.Switch:Play()
  1038. makeShell(Player.Character[Name]:FindFirstChild("Cylinder"))
  1039. Loaded = Loaded - 1
  1040. if magazine.Value ~= 0 then
  1041. magazine.Value = magazine.Value - 1
  1042. updateGui()
  1043. end
  1044. wait(0.02)
  1045. end
  1046. end)()
  1047. CamShake(15, 50000)
  1048. Player.Character[Name].Handle.Release:Play()
  1049. --[[for i = 25, 0, -5 do
  1050. if Player.Character:FindFirstChild("Torso") ~= nil then
  1051. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1052. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1053. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + ((25 - i) / 30), 0.5, 0.6 + ((25 - i) / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), math.rad((25 * 2) - (i * 2)))
  1054. wait()
  1055. else return false end
  1056. else return false end
  1057. end
  1058. for i = 25, 0, -5 do
  1059. if Player.Character:FindFirstChild("Torso") ~= nil then
  1060. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1061. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1062. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + (i / 30), 0.5, 0.6 + (i / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad((25 * 2) - ((25 - i) * 2)))
  1063. wait()
  1064. else return false end
  1065. else return false end
  1066. end
  1067. wait(0.18)--]]
  1068. for i = 0, 35, 5 do
  1069. if Player.Character:FindFirstChild("Torso") ~= nil then
  1070. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1071. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1072. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, -0.4, 0.3) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  1073. wait()
  1074. else return false end
  1075. else return false end
  1076. end
  1077. wait(0.2)
  1078. if ammo.Value >= 6 then
  1079. for i = 1, 6 do
  1080. for i = 5, 0, -1 do
  1081. if Player.Character:FindFirstChild("Torso") ~= nil then
  1082. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1083. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1084. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.85, 0.84) * CFrame.fromEulerAnglesXYZ(math.rad(315 + (i * 1.5)), math.rad(i * 4), math.rad(-90))
  1085. wait()
  1086. else return false end
  1087. else return false end
  1088. end
  1089. Player.Character[Name].Handle.Reload:Play()
  1090. ammo.Value = ammo.Value - 1
  1091. magazine.Value = magazine.Value + 1
  1092. Loaded = Loaded + 1
  1093. updateGui()
  1094. wait(0.1)
  1095. end
  1096. elseif ammo.Value <= 6 then
  1097. for i = 1, ammo.Value do
  1098. for i = 5, 0, -1 do
  1099. if Player.Character:FindFirstChild("Torso") ~= nil then
  1100. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1101. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1102. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.85, 0.84) * CFrame.fromEulerAnglesXYZ(math.rad(315 + (i * 1.5)), math.rad(i * 4), math.rad(-90))
  1103. wait()
  1104. else return false end
  1105. else return false end
  1106. end
  1107. Player.Character[Name].Handle.Reload:Play()
  1108. ammo.Value = ammo.Value - 1
  1109. magazine.Value = magazine.Value + 1
  1110. Loaded = Loaded + 1
  1111. updateGui()
  1112. wait(0.1)
  1113. end
  1114. else end
  1115. wait(0.04)
  1116. coroutine.wrap(function()
  1117. for i = 1, 0, -0.25 do
  1118. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(i * 90), 0) end)
  1119. wait()
  1120. end
  1121. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(0), 0) end)
  1122. end)()
  1123. CamShake(15, 50000)
  1124. Player.Character[Name].Handle.Release:Play()
  1125. for i = 0, 25, 7.5 do
  1126. if Player.Character:FindFirstChild("Torso") ~= nil then
  1127. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1128. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1129. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1130. wait()
  1131. else return false end
  1132. else return false end
  1133. end
  1134. for i = 25, 0, -7.5 do
  1135. if Player.Character:FindFirstChild("Torso") ~= nil then
  1136. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1137. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1138. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1139. wait()
  1140. else return false end
  1141. else return false end
  1142. end
  1143. playAnimation("hold")
  1144. return true
  1145. end
  1146. if format == "reloadDual" then
  1147. for i = 0, 25, 7.5 do
  1148. if Player.Character:FindFirstChild("Torso") ~= nil then
  1149. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1150. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1151. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  1152. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1153. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1154. wait()
  1155. else return false end
  1156. else return false end
  1157. end
  1158. CamShake(1, 40000)
  1159. Player.Character[Name].Handle.Release:Play()
  1160. coroutine.wrap(function()
  1161. for i = 0, 90, 15 do
  1162. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) end)
  1163. pcall(function() Player.Character[Name.. " (Left)"].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) end)
  1164. wait()
  1165. end
  1166. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) end)
  1167. pcall(function() Player.Character[Name.. " (Left)"].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) end)
  1168. end)()
  1169. for i = 0, 25, 7.5 do
  1170. if Player.Character:FindFirstChild("Torso") ~= nil then
  1171. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1172. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1173. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  1174. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1175. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1176. wait()
  1177. else return false end
  1178. else return false end
  1179. end
  1180. for i = 125, 0, -15 do
  1181. if Player.Character:FindFirstChild("Torso") ~= nil then
  1182. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1183. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1184. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)
  1185. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1186. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
  1187. wait()
  1188. else return false end
  1189. else return false end
  1190. end
  1191. for i = 1, 6 do
  1192. Player.Character[Name].Handle.Switch:Play()
  1193. makeShell(Player.Character[Name]:FindFirstChild("Cylinder"))
  1194. makeShell(Player.Character[Name.. " (Left)"]:FindFirstChild("Cylinder"))
  1195. wait(0.04)
  1196. end
  1197. magazine.Value = 0
  1198. Player.Character[Name].Handle.Reload:Play()
  1199. for i = 0, 125, 15 do
  1200. if Player.Character:FindFirstChild("Torso") ~= nil then
  1201. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1202. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1203. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)
  1204. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1205. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
  1206. wait()
  1207. else return false end
  1208. else return false end
  1209. end
  1210. coroutine.wrap(function()
  1211. for i = 1, 0, -0.25 do
  1212. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(i * 90), 0) end)
  1213. pcall(function() Player.Character[Name.. " (Left)"].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(i * 90), 0) end)
  1214. wait()
  1215. end
  1216. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(0), 0) end)
  1217. pcall(function() Player.Character[Name.. " (Left)"].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(0), 0) end)
  1218. end)()
  1219. Player.Character[Name].Handle.Release:Play()
  1220. for i = 25, 0, -5 do
  1221. if Player.Character:FindFirstChild("Torso") ~= nil then
  1222. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1223. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1224. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  1225. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1226. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1227. wait()
  1228. else return false end
  1229. else return false end
  1230. end
  1231. end
  1232. if format == "hammer" then
  1233. Player.Character[Name].Handle.Reload:Play()
  1234. for i = 25, 0, -5 do
  1235. if Player.Character:FindFirstChild("Torso") ~= nil then
  1236. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1237. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1238. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + (i / 30), 0.5, 0.6 + (i / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad((25 * 2) - ((25 - i) * 2)))
  1239. wait()
  1240. else return false end
  1241. else return false end
  1242. end
  1243. Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-35), 0, 0)
  1244. end
  1245. if format == "fire" then
  1246. coroutine.resume(coroutine.create(function()
  1247. if Hammer == false then
  1248. Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-35), 0, 0)
  1249. wait(0.04)
  1250. Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.08) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
  1251. else
  1252. Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.08) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
  1253. Hammer = false
  1254. end
  1255. end))
  1256. if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
  1257. if silenced then
  1258. Player.Character[Name].Handle.Fire.Volume = math.random(3, 8) / 10
  1259. Player.Character[Name].Handle.Fire.Pitch = math.random(35, 40) / 15
  1260. Player.Character[Name].Handle.Fire:Play()
  1261. CamShake(15, 50000)
  1262. else
  1263. Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
  1264. Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
  1265. Player.Character[Name].Handle.Fire:Play()
  1266. CamShake(15, 50000)
  1267. end
  1268. else return false end
  1269. if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
  1270. if silenced == false then
  1271. coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
  1272. else end
  1273. else return false end
  1274. for i = 0, 10, 5 do
  1275. if Player.Character:FindFirstChild("Torso") ~= nil then
  1276. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1277. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1278. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
  1279. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1280. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1281. wait()
  1282. else return false end
  1283. else return false end
  1284. end
  1285. for i = 10, 0, -5 do
  1286. if Player.Character:FindFirstChild("Torso") ~= nil then
  1287. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1288. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1289. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
  1290. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1291. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1292. wait()
  1293. else return false end
  1294. else return false end
  1295. end
  1296. end
  1297. if format == "rightFire" then
  1298. coroutine.resume(coroutine.create(function()
  1299. if Hammer == false then
  1300. Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-35), 0, 0)
  1301. wait(0.04)
  1302. Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.08) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
  1303. else
  1304. Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.08) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
  1305. Hammer = false
  1306. end
  1307. end))
  1308. if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
  1309. if silenced then
  1310. Player.Character[Name].Handle.Fire.Volume = math.random(3, 8) / 10
  1311. Player.Character[Name].Handle.Fire.Pitch = math.random(35, 40) / 15
  1312. Player.Character[Name].Handle.Fire:Play()
  1313. CamShake(15, 50000)
  1314. else
  1315. Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
  1316. Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
  1317. Player.Character[Name].Handle.Fire:Play()
  1318. CamShake(15, 50000)
  1319. end
  1320. else return false end
  1321. if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
  1322. if silenced == false then
  1323. coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
  1324. else end
  1325. else return false end
  1326. for i = 0, 10, 5 do
  1327. if Player.Character:FindFirstChild("Torso") ~= nil then
  1328. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1329. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1330. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), 0, math.rad(-10))
  1331. wait()
  1332. else return false end
  1333. else return false end
  1334. end
  1335. for i = 10, 0, -5 do
  1336. if Player.Character:FindFirstChild("Torso") ~= nil then
  1337. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1338. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1339. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), 0, math.rad(-10))
  1340. wait()
  1341. else return false end
  1342. else return false end
  1343. end
  1344. end
  1345. if format == "leftFire" then
  1346. coroutine.resume(coroutine.create(function()
  1347. if Hammer == false then
  1348. Player.Character[Name.. "(Left)"].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-35), 0, 0)
  1349. wait(0.04)
  1350. Player.Character[Name.. "(Left)"].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.08) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
  1351. else
  1352. Player.Character[Name.. "(Left)"].Hammer.Weld.C0 = CFrame.new(0, -0.1, 0.08) * CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0)
  1353. Hammer = false
  1354. end
  1355. end))
  1356. if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") ~= nil then
  1357. if silenced then
  1358. Player.Character[Name.. " (Left)"].Handle.Fire.Volume = math.random(3, 8) / 10
  1359. Player.Character[Name.. " (Left)"].Handle.Fire.Pitch = math.random(25, 40) / 15
  1360. Player.Character[Name.. " (Left)"].Handle.Fire:Play()
  1361. CamShake(15, 50000)
  1362. else
  1363. Player.Character[Name.. " (Left)"].Handle.Fire.Volume = math.random(8, 12) / 10
  1364. Player.Character[Name.. " (Left)"].Handle.Fire.Pitch = math.random(25, 35) / 20
  1365. Player.Character[Name.. " (Left)"].Handle.Fire:Play()
  1366. CamShake(15, 50000)
  1367. end
  1368. end
  1369. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") ~= nil then
  1370. if silenced == false then
  1371. coroutine.resume(coroutine.create(function() Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = true Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = false Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = false end))
  1372. else end
  1373. end
  1374. for i = 0, 10, 5 do
  1375. if Player.Character:FindFirstChild("Torso") ~= nil then
  1376. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1377. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1378. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), 0, math.rad(10))
  1379. wait()
  1380. else return false end
  1381. else return false end
  1382. end
  1383. for i = 10, 0, -5 do
  1384. if Player.Character:FindFirstChild("Torso") ~= nil then
  1385. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1386. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1387. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), 0, math.rad(10))
  1388. wait()
  1389. else return false end
  1390. else return false end
  1391. end
  1392. end
  1393. return true
  1394. end
  1395. function CamShake(time, freq)
  1396. coroutine.resume(coroutine.create(function()
  1397. local cam = game:GetService("Workspace").CurrentCamera
  1398. local time = 10
  1399. local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
  1400. if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
  1401. if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
  1402. cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
  1403. for i = 1, time do
  1404. cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
  1405. wait()
  1406. end
  1407. end))
  1408. end
  1409. function makeShell(part)
  1410. if part == nil then return false end
  1411. local casing = Instance.new("Part")
  1412. casing.Name = "Shell"
  1413. casing.formFactor = "Custom"
  1414. casing.Size = Vector3.new(0.2, 0.26, 0.2)
  1415. casing.CFrame = CFrame.new(part.Position) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
  1416. casing.BrickColor = BrickColor.new("New Yeller")
  1417. local mesh = Instance.new("CylinderMesh")
  1418. mesh.Scale = Vector3.new(0.4, 1, 0.4)
  1419. mesh.Parent = casing
  1420. casing.Parent = game:GetService("Workspace")
  1421. casing:BreakJoints()
  1422. coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
  1423. end
  1424. function Weld(x, y)
  1425. local weld = Instance.new("Weld")
  1426. weld.Part0 = x
  1427. weld.Part1 = y
  1428. CJ = CFrame.new(x.Position)
  1429. C0 = x.CFrame:inverse() * CJ
  1430. C1 = y.CFrame:inverse() * CJ
  1431. weld.C0 = C0
  1432. weld.C1 = C1
  1433. weld.Parent = x
  1434. end
  1435. function tagHumanoid(humanoid)
  1436. local tag = Instance.new("ObjectValue")
  1437. tag.Name = "creator"
  1438. tag.Value = Player
  1439. tag.Parent = humanoid
  1440. local tag = Instance.new("StringValue")
  1441. tag.Name = "creatorType1"
  1442. tag.Value = Name
  1443. tag.Parent = humanoid
  1444. local tag = Instance.new("StringValue")
  1445. tag.Name = "creatorType2"
  1446. tag.Value = "shot"
  1447. tag.Parent = humanoid
  1448. end
  1449. function untagHumanoid(humanoid)
  1450. if humanoid ~= nil then
  1451. local tag = humanoid:FindFirstChild("creator")
  1452. if tag ~= nil then
  1453. tag:Remove()
  1454. end
  1455. local tag = humanoid:FindFirstChild("creatorType1")
  1456. if tag ~= nil then
  1457. tag:Remove()
  1458. end
  1459. local tag = humanoid:FindFirstChild("creatorType2")
  1460. if tag ~= nil then
  1461. tag:Remove()
  1462. end
  1463. end
  1464. end
  1465. function fire(startPoint, endPoint, hit)
  1466. local trail = Instance.new("Part")
  1467. trail.Name = "Bullet Trail"
  1468. trail.BrickColor = BrickColor.new("New Yeller")
  1469. trail.TopSurface = 0
  1470. trail.BottomSurface = 0
  1471. trail.formFactor = 0
  1472. trail.Size = Vector3.new(1, 1, 1)
  1473. trail.Transparency = 0.5
  1474. trail.Anchored = true
  1475. trail.CanCollide = false
  1476. trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
  1477. trail.Parent = game:GetService("Workspace")
  1478. local mesh = Instance.new("SpecialMesh")
  1479. mesh.MeshType = "Brick"
  1480. mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude)
  1481. mesh.Parent = trail
  1482. coroutine.resume(coroutine.create(function(part) for i = 1, 10 do part.Mesh.Scale = Vector3.new(part.Mesh.Scale.x - 0.01, part.Mesh.Scale.y - 0.01, part.Mesh.Scale.z) wait() end part:Remove() end), trail)
  1483. if hit ~= nil then
  1484. if hit.Parent == nil then return end
  1485. if hit.Parent.ClassName == "Hat" then
  1486. if hit.Parent.Parent.Humanoid ~= nil then
  1487. hit.Parent.Parent.Humanoid:TakeDamage(damage * 5)
  1488. end
  1489. end
  1490. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1491. tagHumanoid(hit.Parent.Humanoid)
  1492. if hit.Name == "Head" then
  1493. hit.Parent.Humanoid:TakeDamage(damage * 10)
  1494. elseif hit.Name == "Torso" then
  1495. hit.Parent.Humanoid:TakeDamage(damage * 2)
  1496. elseif hit.Name == "Left Leg" then
  1497. hit.Parent.Humanoid:TakeDamage(damage)
  1498. hit.Parent.Humanoid.Sit = false
  1499. elseif hit.Name == "Right Leg" then
  1500. hit.Parent.Humanoid:TakeDamage(damage)
  1501. hit.Parent.Humanoid.Sit = false
  1502. else
  1503. hit.Parent.Humanoid:TakeDamage(damage)
  1504. end
  1505. if math.random(1, 10) == 1 then
  1506. hit.Parent.Humanoid.Sit = false
  1507. end
  1508. delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
  1509. end
  1510. if hit.Anchored == false then
  1511. hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2))
  1512. end
  1513. end
  1514. end
  1515. function onButton1Down(mouse)
  1516. if selected == false then return end
  1517. if Player.Character:FindFirstChild(Name) ~= nil and Button1Down == false and canFire == true and (function() if dual == true then if Player.Character:FindFirstChild(Name.. " (Left)") ~= nil then return true else return false end else return true end end)() == true then
  1518. if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
  1519. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1520. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
  1521. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
  1522. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  1523. Button1Down = true
  1524. canFire = false
  1525. canFire2 = true
  1526. while canFire2 == true do
  1527. local humanoid = Player.Character:FindFirstChild("Humanoid")
  1528. if humanoid == nil then
  1529. canFire2 = false
  1530. break
  1531. end
  1532. if humanoid.Health <= 0 then
  1533. canFire2 = false
  1534. break
  1535. end
  1536. local fireLeft = false
  1537. if automatic == false and burst == false then
  1538. canFire2 = false
  1539. elseif automatic == false and burst == true then
  1540. if burstCount >= burstCountMax then
  1541. canFire2 = false
  1542. burstCount = 0
  1543. break
  1544. end
  1545. burstCount = burstCount + 1
  1546. elseif automatic == true and burst == false then
  1547. fireLeft = true
  1548. end
  1549. if magazine.Value > 0 then
  1550. magazine.Value = magazine.Value - Chamber
  1551. updateGui()
  1552. if silenced == true then
  1553. CamShake(1, Spread)
  1554. else end
  1555. fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1556. coroutine.resume(coroutine.create(function()
  1557. if dual == true then
  1558. playAnimation("rightFire")
  1559. elseif dual == false then
  1560. playAnimation("fire")
  1561. end
  1562. end))
  1563. if dual == true then
  1564. wait(math.random(0, 0.15))
  1565. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1566. coroutine.resume(coroutine.create(function()
  1567. playAnimation("leftFire")
  1568. end))
  1569. end
  1570. else
  1571. Player.Character[Name].Handle.Empty:Play()
  1572. end
  1573. if fireLeft == true and dual == true and automatic == true then
  1574. if magazine.Value > 0 then
  1575. coroutine.resume(coroutine.create(function()
  1576. wait(readyTime / 2)
  1577. magazine.Value = magazine.Value - 1
  1578. updateGui()
  1579. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1580. if silenced == true then
  1581. CamShake(1, Spread)
  1582. else end
  1583. playAnimation("leftFire")
  1584. end))
  1585. else
  1586. coroutine.resume(coroutine.create(function()
  1587. wait(readyTime / 2)
  1588. Player.Character[Name].Handle.Empty:Play()
  1589. end))
  1590. end
  1591. end
  1592. wait(readyTime)
  1593. end
  1594. if magazine.Value ~= 0 then
  1595. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  1596. else end
  1597. canFire = true
  1598. end
  1599. end
  1600. function onButton1Up(mouse)
  1601. if selected == false then return end
  1602. Button1Down = false
  1603. canFire2 = false
  1604. burstCount = 0
  1605. while canFire == false do wait() end
  1606. if dual == true and automatic == false then
  1607. if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
  1608. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1609. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  1610. canFire = false
  1611. canFire2 = true
  1612. while canFire2 == true do
  1613. local humanoid = Player.Character:FindFirstChild("Humanoid")
  1614. if humanoid == nil then
  1615. canFire2 = false
  1616. break
  1617. end
  1618. if humanoid.Health <= 0 then
  1619. canFire2 = false
  1620. break
  1621. end
  1622. if burst == false then
  1623. canFire2 = false
  1624. elseif burst == true then
  1625. if burstCount >= burstCountMax then
  1626. canFire2 = false
  1627. burstCount = 0
  1628. break
  1629. end
  1630. burstCount = burstCount + 1
  1631. end
  1632. if magazine.Value <= 0 then
  1633. Player.Character[Name].Handle.Empty:Play()
  1634. else end
  1635. end
  1636. if magazine.Value ~= 0 then
  1637. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  1638. else end
  1639. canFire = true
  1640. end
  1641. end
  1642. function onKeyDown(key, mouse)
  1643. if selected == false then return end
  1644. key = key:lower()
  1645. if key == "q" and Button1Down == false and canFire == true then
  1646. if mouse.Target == nil then return end
  1647. if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
  1648. if dual == true then onKeyDown("t", mouse) end
  1649. onDeselected(mouse)
  1650. removeParts("RightHolster")
  1651. script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
  1652. end
  1653. end
  1654. if key == "e" and Button1Down == false and canFire == true and canSilence == true then
  1655. if silenced then
  1656. silenced = false
  1657. Player.Character[Name].Handle.Lock.Pitch = 5
  1658. Player.Character[Name].Handle.Lock:Play()
  1659. if Player.Character:FindFirstChild(Name) == nil then return end
  1660. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1661. if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
  1662. Player.Character[Name].Muzzle.Transparency = 1
  1663. Player.Character[Name].Muzzle.Name = "Silencer"
  1664. Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
  1665. if dual == true then
  1666. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1667. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
  1668. Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
  1669. Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
  1670. Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
  1671. end
  1672. else
  1673. silenced = true
  1674. Player.Character[Name].Handle.Lock.Pitch = 5
  1675. Player.Character[Name].Handle.Lock:Play()
  1676. if Player.Character:FindFirstChild(Name) == nil then return end
  1677. if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
  1678. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1679. Player.Character[Name].Silencer.Transparency = 0
  1680. Player.Character[Name].Muzzle.Name = "Muzzle 2"
  1681. Player.Character[Name].Silencer.Name = "Muzzle"
  1682. if dual == true then
  1683. if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
  1684. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1685. Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
  1686. Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
  1687. Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
  1688. end
  1689. end
  1690. end
  1691. if key == "r" and Button1Down == false and canFire == true then
  1692. if ammo.Value > 0 and magazine.Value ~= magazineMax.Value then
  1693. canFire = false
  1694. burstCount = 0
  1695. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  1696. updateGui()
  1697. if dual == true then
  1698. playAnimation("reloadDual")
  1699. elseif dual == false then
  1700. playAnimation("reload")
  1701. end
  1702. if dual == true then
  1703. if ammo.Value - magazineMax.Value < 0 then
  1704. magazine.Value = ammo.Value
  1705. ammo.Value = 0
  1706. elseif ammo.Value - magazineMax.Value >= 0 then
  1707. ammo.Value = ammo.Value - magazineMax.Value
  1708. magazine.Value = magazine.Value + magazineMax.Value
  1709. end
  1710. else end
  1711. updateGui()
  1712. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  1713. canFire = true
  1714. end
  1715. end
  1716. if key == "t" and Button1Down == false and canFire == true and canDual == true then
  1717. canFire = false
  1718. if dual == false then
  1719. local weapon = nil
  1720. for _, p in pairs(Player.Backpack:GetChildren()) do
  1721. if p.Name == Name and p ~= script.Parent then weapon = p break end
  1722. end
  1723. if weapon ~= nil then
  1724. dual = true
  1725. Chamber = 2
  1726. weapon.Name = "Dual"
  1727. weapon.Parent = script
  1728. removeParts("RightHand")
  1729. makeParts("RightHand")
  1730. removeParts("RightHolster")
  1731. makeParts("LeftHolster")
  1732. playAnimation("leftEquip")
  1733. removeParts("LeftHolster")
  1734. makeParts("LeftHand")
  1735. magazineMax.Value = math.ceil(magazineMax.Value * 2)
  1736. ammoMax.Value = math.ceil(ammoMax.Value * 2)
  1737. magazine.Value = magazine.Value + weapon.Magazine.Value
  1738. ammo.Value = ammo.Value + weapon.Ammo.Value
  1739. updateGui()
  1740. end
  1741. elseif dual == true then
  1742. local weapon = script:FindFirstChild("Dual")
  1743. if weapon ~= nil then
  1744. dual = false
  1745. Chamber = 1
  1746. weapon.Name = Name
  1747. weapon.Parent = Player.Backpack
  1748. removeParts("RightHand")
  1749. makeParts("RightHand")
  1750. playAnimation("leftUnequip")
  1751. removeParts("LeftHand")
  1752. makeParts("RightHolster")
  1753. playAnimation("hold")
  1754. weapon.Magazine.Value = math.floor(magazine.Value / 2)
  1755. weapon.Ammo.Value = math.floor(ammo.Value / 2)
  1756. magazineMax.Value = math.ceil(magazineMax.Value / 2)
  1757. ammoMax.Value = math.ceil(ammoMax.Value / 2)
  1758. magazine.Value = math.ceil(magazine.Value / 2)
  1759. ammo.Value = math.ceil(ammo.Value / 2)
  1760. updateGui()
  1761. end
  1762. end
  1763. canFire = true
  1764. end
  1765. if key == "y" and canZoom == true then
  1766. if zoom == false then
  1767. zoom = true
  1768. local pos = mouse.Hit.p
  1769. local target = mouse.Target
  1770. local cam = game:GetService("Workspace").CurrentCamera
  1771. focus = Instance.new("Part", workspace)
  1772. focus.Anchored = true
  1773. focus.CanCollide = false
  1774. focus.Transparency = 1
  1775. focus.TopSurface = 0
  1776. focus.BottomSurface = 0
  1777. focus.formFactor = "Plate"
  1778. focus.Size = Vector3.new(0, 0, 0)
  1779. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  1780. cam.CameraSubject = focus
  1781. cam.CameraType = "Attach"
  1782. while zoom == true and selected == true do
  1783. local set = false
  1784. if target ~= nil then
  1785. if target.Parent ~= nil then
  1786. if target.Anchored == false then
  1787. focus.CFrame = CFrame.new(target.CFrame.p) * (CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p) - CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p).p)
  1788. set = true
  1789. end
  1790. end
  1791. end
  1792. if set == false then
  1793. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  1794. end
  1795. wait()
  1796. end
  1797. if focus ~= nil then focus:Remove() focus = nil end
  1798. local cam = game:GetService("Workspace").CurrentCamera
  1799. cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
  1800. cam.CameraType = "Custom"
  1801. else
  1802. zoom = false
  1803. end
  1804. end
  1805. if key == "u" and Button1Down == false and canFire == true then
  1806. if automatic == false and burst == false then
  1807. if switchToBurst == true then
  1808. burst = true
  1809. local m = Instance.new("Message", Player)
  1810. m.Text = "Burst"
  1811. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1812. delay(2.5, function() m:Remove() end)
  1813. elseif switchToAutomatic == true then
  1814. automatic = true
  1815. local m = Instance.new("Message", Player)
  1816. m.Text = "Automatic"
  1817. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1818. delay(2.5, function() m:Remove() end)
  1819. end
  1820. elseif automatic == false and burst == true then
  1821. if switchToAutomatic == true then
  1822. automatic = true
  1823. burst = false
  1824. local m = Instance.new("Message", Player)
  1825. m.Text = "Automatic"
  1826. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1827. delay(2.5, function() m:Remove() end)
  1828. elseif switchToSingle == true then
  1829. burst = false
  1830. local m = Instance.new("Message", Player)
  1831. m.Text = "Single"
  1832. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1833. delay(2.5, function() m:Remove() end)
  1834. end
  1835. elseif automatic == true and burst == false then
  1836. if switchToSingle == true then
  1837. automatic = false
  1838. local m = Instance.new("Message", Player)
  1839. m.Text = "Single"
  1840. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1841. delay(2.5, function() m:Remove() end)
  1842. elseif switchToBurst == true then
  1843. automatic = false
  1844. burst = true
  1845. local m = Instance.new("Message", Player)
  1846. m.Text = "Burst"
  1847. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  1848. delay(2.5, function() m:Remove() end)
  1849. end
  1850. end
  1851. end
  1852. if key == "c" and Hammer == false and dual == false and canFire == true then
  1853. playAnimation("hammer")
  1854. Hammer = true
  1855. end
  1856. end
  1857. function onSelected(mouse)
  1858. if selected == true then return end
  1859. selected = true
  1860. canFire = false
  1861. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  1862. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  1863. if Player.Character.WeaponActivated.Value == nil then break end
  1864. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  1865. wait()
  1866. end
  1867. updateGui()
  1868. local weapon = Instance.new("ObjectValue")
  1869. weapon.Name = "WeaponActivated"
  1870. weapon.Value = script.Parent
  1871. weapon.Parent = Player.Character
  1872. DisableLimb(1, Player.Character)
  1873. DisableLimb(2, Player.Character)
  1874. ForceAngle(1, 0, Player.Character)
  1875. ForceAngle(2, 0, Player.Character)
  1876. if dual == true then
  1877. coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
  1878. playAnimation("rightEquip")
  1879. removeParts("LeftHolster")
  1880. makeParts("LeftHand")
  1881. else
  1882. playAnimation("equip")
  1883. end
  1884. removeParts("RightHolster")
  1885. makeParts("RightHand")
  1886. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  1887. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  1888. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  1889. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  1890. canFire = true
  1891. end
  1892. function onDeselected(mouse)
  1893. if selected == false then return end
  1894. Button1Down = false
  1895. while canFire == false do
  1896. wait()
  1897. end
  1898. selected = false
  1899. if dual == true then
  1900. if math.random(1, 2) == 1 then
  1901. coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
  1902. wait(math.random(1, 10) / 10)
  1903. playAnimation("rightUnequip")
  1904. else
  1905. coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
  1906. wait(math.random(1, 10) / 10)
  1907. playAnimation("leftUnequip")
  1908. end
  1909. removeParts("LeftHand")
  1910. makeParts("LeftHolster")
  1911. else
  1912. playAnimation("unequip")
  1913. end
  1914. removeParts("RightHand")
  1915. makeParts("RightHolster")
  1916. ForceAngle(1, 0, Player.Character)
  1917. ForceAngle(2, 0, Player.Character)
  1918. ResetLimbCFrame(1, Player.Character)
  1919. ResetLimbCFrame(2, Player.Character)
  1920. EnableLimb(1, Player.Character)
  1921. EnableLimb(2, Player.Character)
  1922. if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
  1923. if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
  1924. if Player.Character.WeaponActivated.Value == script.Parent then
  1925. Player.Character.WeaponActivated:Remove()
  1926. end
  1927. end
  1928. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  1929. if Player.Character.WeaponActivated.Value == nil then break end
  1930. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  1931. wait()
  1932. end
  1933. end
  1934. if script.Parent.className ~= "HopperBin" then
  1935. if Player == nil then print("Error: Player not found!") return end
  1936. Tool = Instance.new("HopperBin")
  1937. Tool.Name = Name
  1938. Tool.Parent = Player.Backpack
  1939. script.Name = "Main"
  1940. script.Parent = Tool
  1941. elseif script.Parent.className == "HopperBin" then
  1942. while script.Parent.Parent.className ~= "Backpack" do
  1943. wait()
  1944. end
  1945. if script.Parent:FindFirstChild("MagazineMax") == nil then
  1946. magazineMax = Instance.new("NumberValue")
  1947. magazineMax.Name = "MagazineMax"
  1948. magazineMax.Value = 1333333333333333337
  1949. magazineMax.Parent = script.Parent
  1950. else
  1951. magazineMax = script.Parent.MagazineMax
  1952. end
  1953. if script.Parent:FindFirstChild("Magazine") == nil then
  1954. magazine = Instance.new("NumberValue")
  1955. magazine.Name = "Magazine"
  1956. magazine.Value = 133333333333333333337
  1957. magazine.Parent = script.Parent
  1958. else
  1959. magazine = script.Parent.Magazine
  1960. end
  1961. if script.Parent:FindFirstChild("AmmoMax") == nil then
  1962. ammoMax = Instance.new("NumberValue")
  1963. ammoMax.Name = "AmmoMax"
  1964. ammoMax.Value = 133333333333333333333333333333333333333333333333333333333337
  1965. ammoMax.Parent = script.Parent
  1966. else
  1967. ammoMax = script.Parent.AmmoMax
  1968. end
  1969. if script.Parent:FindFirstChild("Ammo") == nil then
  1970. ammo = Instance.new("NumberValue")
  1971. ammo.Name = "Ammo"
  1972. ammo.Value = script.Parent.AmmoMax.Value
  1973. ammo.Parent = script.Parent
  1974. else
  1975. ammo = script.Parent.Ammo
  1976. end
  1977. Player = script.Parent.Parent.Parent
  1978. makeParts("RightHolster")
  1979. script.Parent.Selected:connect(onSelected)
  1980. script.Parent.Deselected:connect(onDeselected)
  1981. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement