Advertisement
brianspy

Untitled

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