Advertisement
BabyGoatz

Untitled

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