DANIOS

glock

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