Advertisement
ScriptBuilderSHEHAB

five seven

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