Advertisement
Guest User

gun

a guest
Jan 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 92.58 KB | None | 0 0
  1. Player = game:GetService("Players").LocalPlayer
  2. Char = Player.Character
  3. animate = Char:findFirstChild("Animate")
  4. if animate then
  5. animate:Destroy()
  6. end
  7.  
  8. Name = "Glock"
  9. MC = BrickColor.new("Black")
  10. GC = BrickColor.new("Grime")
  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 = false
  20. dual = false
  21. Button1Down = false
  22. damage = 25
  23. canFire = true
  24. canFire2 = false
  25. readyTime = 0.1
  26. automatic = false
  27. burst = false
  28. burstCount = 0
  29. burstCountMax = 3
  30. canSilence = false
  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 = " 9x19mm:"
  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.Name = "Smoke"
  810. s.RiseVelocity = -5
  811. s.Opacity = 0.3
  812. s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
  813. s.Size = 1
  814. s.Parent = p
  815. local f = Instance.new("Fire")
  816. f.Enabled = false
  817. f.Name = "Fire"
  818. f.Heat = -35
  819. f.Size = 1
  820. f.Parent = p
  821. p.Touched:connect(function(hit) onTouched(hit, p, "pistol") end)
  822. local p = Instance.new("Part")
  823. if silenced == false then
  824. p.Name = "Silencer"
  825. p.Transparency = 1
  826. else
  827. p.Name = "Muzzle"
  828. p.Transparency = 0
  829. end
  830. p.formFactor = "Symmetric"
  831. p.Size = Vector3.new(1, 1, 1)
  832. p.BrickColor = BrickColor.new("Really black")
  833. p.Reflectance = 0
  834. p.CanCollide = false
  835. p.Locked = true
  836. p.TopSurface = 0
  837. p.BottomSurface = 0
  838. p.Parent = model
  839. local m = Instance.new("CylinderMesh")
  840. m.Scale = Vector3.new(0.2, 0.8, 0.2)
  841. m.Parent = p
  842. local w = Instance.new("Weld")
  843. w.Part0 = p
  844. w.Part1 = pm
  845. w.C0 = CFrame.new(0, 1.26, 0.07)
  846. w.C1 = CFrame.new()
  847. w.Parent = p
  848. local p = Instance.new("Part")
  849. p.Name = "Silencer1"
  850. if silenced == false then
  851. p.Transparency = 1
  852. else
  853. p.Transparency = 0
  854. end
  855. p.formFactor = "Symmetric"
  856. p.Size = Vector3.new(1, 1, 1)
  857. p.BrickColor = BrickColor.new("Black")
  858. p.Reflectance = 0
  859. p.CanCollide = false
  860. p.Locked = true
  861. p.TopSurface = 0
  862. p.BottomSurface = 0
  863. p.Parent = model
  864. local m = Instance.new("CylinderMesh")
  865. m.Scale = Vector3.new(0.21, 0.6, 0.21)
  866. m.Parent = p
  867. local w = Instance.new("Weld")
  868. w.Part0 = p
  869. w.Part1 = pm
  870. w.C0 = CFrame.new(0, 1.26, 0.07)
  871. w.C1 = CFrame.new()
  872. w.Parent = p
  873. return model
  874. end
  875.  
  876.  
  877. function removeParts(format)
  878. if format == "RightHand" then
  879. pcall(function() Player.Character[Name]:Remove() end)
  880. elseif format == "LeftHand" then
  881. pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
  882. elseif format == "RightHolster" then
  883. pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
  884. elseif format == "LeftHolster" then
  885. pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
  886. end
  887. end
  888.  
  889.  
  890. function onTouched(hit, source, format)
  891. if format == "pistol" then
  892. if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent ~= Player.Character then
  893. tagHumanoid(hit.Parent.Humanoid)
  894. if canHit == true and melee == true then
  895. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 50
  896. Player.Character[Name].Handle.Impact:Play()
  897. hit.Parent.Humanoid.Sit = true
  898. melee = false
  899. wait(0.8)
  900. melee = true
  901. end
  902. delay(3, function() untagHumanoid(hit.Parent.Humanoid) end)
  903. end
  904. end
  905. end
  906.  
  907.  
  908. function SetAngle(Joint, Angle, Character)
  909. if Character == nil then return false end
  910. local Joints = {
  911. Character.Torso:FindFirstChild("Right Shoulder 2"),
  912. Character.Torso:FindFirstChild("Left Shoulder 2"),
  913. Character.Torso:FindFirstChild("Right Hip 2"),
  914. Character.Torso:FindFirstChild("Left Hip 2")
  915. }
  916. if Joints[Joint] == nil then return false end
  917. if Joint == 1 or Joint == 3 then
  918. Joints[Joint].DesiredAngle = Angle
  919. end
  920. if Joint == 2 or Joint == 4 then
  921. Joints[Joint].DesiredAngle = -Angle
  922. end
  923. end
  924.  
  925.  
  926. function ForceAngle(Joint, Angle, Character)
  927. if Character == nil then return false end
  928. local Joints = {
  929. Character.Torso:FindFirstChild("Right Shoulder 2"),
  930. Character.Torso:FindFirstChild("Left Shoulder 2"),
  931. Character.Torso:FindFirstChild("Right Hip 2"),
  932. Character.Torso:FindFirstChild("Left Hip 2")
  933. }
  934. if Joints[Joint] == nil then return false end
  935. if Joint == 1 or Joint == 3 then
  936. Joints[Joint].DesiredAngle = Angle
  937. Joints[Joint].CurrentAngle = Angle
  938. end
  939. if Joint == 2 or Joint == 4 then
  940. Joints[Joint].DesiredAngle = -Angle
  941. Joints[Joint].CurrentAngle = -Angle
  942. end
  943. end
  944.  
  945.  
  946. function SetSpeed(Joint, Speed, Character)
  947. if Character == nil then return false end
  948. local Joints = {
  949. Character.Torso:FindFirstChild("Right Shoulder 2"),
  950. Character.Torso:FindFirstChild("Left Shoulder 2"),
  951. Character.Torso:FindFirstChild("Right Hip 2"),
  952. Character.Torso:FindFirstChild("Left Hip 2")
  953. }
  954. if Joints[Joint] == nil then return false end
  955. Joints[Joint].MaxVelocity = Speed
  956. end
  957.  
  958.  
  959. function DisableLimb(Limb, Character)
  960. if Character == nil then return false end
  961. if Character:FindFirstChild("Torso") == nil then return false end
  962. local Joints = {
  963. Character.Torso:FindFirstChild("Right Shoulder"),
  964. Character.Torso:FindFirstChild("Left Shoulder"),
  965. Character.Torso:FindFirstChild("Right Hip"),
  966. Character.Torso:FindFirstChild("Left Hip")
  967. }
  968. local Limbs = {
  969. Character:FindFirstChild("Right Arm"),
  970. Character:FindFirstChild("Left Arm"),
  971. Character:FindFirstChild("Right Leg"),
  972. Character:FindFirstChild("Left Leg")
  973. }
  974. if Joints[Limb] == nil then return false end
  975. if Limbs[Limb] == nil then return false end
  976. local Joint = Instance.new("Motor")
  977. Joint.Parent = Character.Torso
  978. Joint.Part0 = Character.Torso
  979. Joint.Part1 = Limbs[Limb]
  980. if Limb == 1 then
  981. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  982. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  983. Joint.Name = "Right Shoulder 2"
  984. elseif Limb == 2 then
  985. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  986. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  987. Joint.Name = "Left Shoulder 2"
  988. elseif Limb == 3 then
  989. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  990. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  991. Joint.Name = "Right Hip 2"
  992. elseif Limb == 4 then
  993. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  994. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  995. Joint.Name = "Left Hip 2"
  996. end
  997. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  998. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  999. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  1000. Joints[Limb]:Remove()
  1001. end
  1002.  
  1003.  
  1004. function ResetLimbCFrame(Limb, Character)
  1005. if Character == nil then return false end
  1006. if Character.Parent == nil then return false end
  1007. if Character:FindFirstChild("Torso") == nil then return false end
  1008. local Joints = {
  1009. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1010. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1011. Character.Torso:FindFirstChild("Right Hip 2"),
  1012. Character.Torso:FindFirstChild("Left Hip 2")
  1013. }
  1014. local Limbs = {
  1015. Character:FindFirstChild("Right Arm"),
  1016. Character:FindFirstChild("Left Arm"),
  1017. Character:FindFirstChild("Right Leg"),
  1018. Character:FindFirstChild("Left Leg")
  1019. }
  1020. if Joints[Limb] == nil then return false end
  1021. if Limbs[Limb] == nil then return false end
  1022. if Limb == 1 then
  1023. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1024. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1025. elseif Limb == 2 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 == 3 then
  1029. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1030. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1031. elseif Limb == 4 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. end
  1035. end
  1036.  
  1037.  
  1038. function EnableLimb(Limb, Character)
  1039. if Character == nil then return false end
  1040. if Character:FindFirstChild("Torso") == nil then return false end
  1041. local Joints = {
  1042. Character.Torso:FindFirstChild("Right Shoulder 2"),
  1043. Character.Torso:FindFirstChild("Left Shoulder 2"),
  1044. Character.Torso:FindFirstChild("Right Hip 2"),
  1045. Character.Torso:FindFirstChild("Left Hip 2")
  1046. }
  1047. local Limbs = {
  1048. Character:FindFirstChild("Right Arm"),
  1049. Character:FindFirstChild("Left Arm"),
  1050. Character:FindFirstChild("Right Leg"),
  1051. Character:FindFirstChild("Left Leg")
  1052. }
  1053. if Joints[Limb] == nil then return false end
  1054. if Limbs[Limb] == nil then return false end
  1055. if Limb == 1 then
  1056. Joints[Limb].Name = "Right Shoulder"
  1057. elseif Limb == 2 then
  1058. Joints[Limb].Name = "Left Shoulder"
  1059. elseif Limb == 3 then
  1060. Joints[Limb].Name = "Right Hip"
  1061. elseif Limb == 4 then
  1062. Joints[Limb].Name = "Left Hip"
  1063. end
  1064. Animate = Character:FindFirstChild("Animate")
  1065. if Animate == nil then return false end
  1066. Animate = Animate:Clone()
  1067. Character.Animate:Remove()
  1068. Animate.Parent = Character
  1069. end
  1070.  
  1071.  
  1072. function playAnimation(format, mouse)
  1073. if format == "equip" then
  1074. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  1075. local w = Instance.new("Weld")
  1076. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  1077. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  1078. w.C0 = CFrame.new(0, 1.2, 0.7)
  1079. w.C1 = CFrame.new()
  1080. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  1081. for i = 0.01, 1, 0.1 do
  1082. if Player.Character:FindFirstChild("Torso") ~= nil then
  1083. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1084. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1085. 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)
  1086. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1087. 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)
  1088. wait()
  1089. else return false end
  1090. else return false end
  1091. end
  1092. return playAnimation("hold")
  1093. end
  1094. if format == "rightEquip" then
  1095. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  1096. local w = Instance.new("Weld")
  1097. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  1098. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  1099. w.C0 = CFrame.new(0, 1.2, 0.7)
  1100. w.C1 = CFrame.new()
  1101. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  1102. for i = 0.01, 1, 0.1 do
  1103. if Player.Character:FindFirstChild("Torso") ~= nil then
  1104. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1105. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1106. 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)
  1107. wait()
  1108. else return false end
  1109. else return false end
  1110. end
  1111. return playAnimation("rightHold")
  1112. end
  1113. if format == "leftEquip" then
  1114. Player.Character[Name.. " (Holstered, Left)"].Handle.Weld:Remove()
  1115. local w = Instance.new("Weld")
  1116. w.Part0 = Player.Character[Name.. " (Holstered, Left)"].Handle
  1117. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1118. w.C0 = CFrame.new(0, 1.2, 0.7)
  1119. w.C1 = CFrame.new()
  1120. w.Parent = Player.Character[Name.. " (Holstered, Left)"].Handle
  1121. for i = 0.01, 1, 0.1 do
  1122. if Player.Character:FindFirstChild("Torso") ~= nil then
  1123. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1124. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1125. 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)
  1126. wait()
  1127. else return false end
  1128. else return false end
  1129. end
  1130. return playAnimation("leftHold")
  1131. end
  1132. if format == "unequip" then
  1133. for i = 1, 0.01, -0.1 do
  1134. if Player.Character:FindFirstChild("Torso") ~= nil then
  1135. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1136. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1137. 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)
  1138. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1139. 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)
  1140. wait()
  1141. else return false end
  1142. else return false end
  1143. end
  1144. return true
  1145. end
  1146. if format == "leftUnequip" then
  1147. for i = 1, 0.01, -0.1 do
  1148. if Player.Character:FindFirstChild("Torso") ~= nil then
  1149. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1150. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1151. 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)
  1152. wait()
  1153. else return false end
  1154. else return false end
  1155. end
  1156. return true
  1157. end
  1158. if format == "rightUnequip" then
  1159. for i = 1, 0.01, -0.1 do
  1160. if Player.Character:FindFirstChild("Torso") ~= nil then
  1161. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1162. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1163. 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)
  1164. wait()
  1165. else return false end
  1166. else return false end
  1167. end
  1168. return true
  1169. end
  1170. if format == "hold" then
  1171. if Player.Character:FindFirstChild("Torso") ~= nil then
  1172. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1173. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1174. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  1175. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1176. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1177. else return false end
  1178. else return false end
  1179. end
  1180. if format == "rightHold" then
  1181. if Player.Character:FindFirstChild("Torso") ~= nil then
  1182. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1183. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1184. 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))
  1185. else return false end
  1186. else return false end
  1187. end
  1188. if format == "leftHold" then
  1189. if Player.Character:FindFirstChild("Torso") ~= nil then
  1190. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1191. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1192. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(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 == "reload" then
  1197. coroutine.wrap(function()
  1198. Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.7, 0.68)
  1199. for i = 0, 30, 15 do
  1200. pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
  1201. wait()
  1202. end
  1203. pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-30), 0, 0) end)
  1204. end)()
  1205. Player.Character[Name].Handle.Empty:Play()
  1206. for i = 0, 25, 7.5 do
  1207. if Player.Character:FindFirstChild("Torso") ~= nil then
  1208. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1209. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1210. 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)
  1211. wait()
  1212. else return false end
  1213. else return false end
  1214. end
  1215. Player.Character[Name].Handle.Release:Play()
  1216. Player.Character[Name].Shell.Transparency = 1
  1217. Player.Character[Name].Magazine.Transparency = 1
  1218. CamShake(15, 50000)
  1219. local magazineDrop = Player.Character[Name].Magazine:Clone()
  1220. magazineDrop.Transparency = 0
  1221. magazineDrop.Parent = game:GetService("Workspace")
  1222. 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)
  1223. delay(0.1, function() magazineDrop.CanCollide = true end)
  1224. Player.Character[Name].Handle.Reload:Play()
  1225. local magazineNew = Player.Character[Name].Magazine:Clone()
  1226. magazineNew.Name = "New Magazine"
  1227. magazineNew.Transparency = 0
  1228. magazineNew.Parent = Player.Character[Name]
  1229. local w = Instance.new("Weld")
  1230. w.Part0 = magazineNew
  1231. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1232. w.C0 = CFrame.new(0, 1.1, 0)
  1233. w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1234. w.Parent = magazineNew
  1235. for i = 25, 0, -5 do
  1236. if Player.Character:FindFirstChild("Torso") ~= nil then
  1237. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1238. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1239. 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))
  1240. wait()
  1241. else return false end
  1242. else return false end
  1243. end
  1244. Player.Character[Name].Magazine.Transparency = 0
  1245. Player.Character[Name].Shell.Transparency = 0
  1246. Player.Character[Name]["New Magazine"]:Remove()
  1247. for i = 25, 0, -7.5 do
  1248. if Player.Character:FindFirstChild("Torso") ~= nil then
  1249. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1250. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1251. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5 + (i * 0.025), 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5 + (i * 0.8)), 0)
  1252. wait()
  1253. else return false end
  1254. else return false end
  1255. end
  1256. coroutine.wrap(function()
  1257. Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)
  1258. for i = 30, 0, -15 do
  1259. pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
  1260. wait()
  1261. end
  1262. pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0) end)
  1263. end)()
  1264. for i = 0, 10, 5 do
  1265. if Player.Character:FindFirstChild("Torso") ~= nil then
  1266. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1267. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1268. 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))
  1269. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1270. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  1271. wait()
  1272. else return false end
  1273. else return false end
  1274. end
  1275. if magazine.Value == 0 then
  1276. wait(0.02)
  1277. Player.Character[Name].Handle.Lock.Pitch = 1.5
  1278. Player.Character[Name].Handle.Lock:Play()
  1279. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
  1280. CamShake(1, 50000)
  1281. CamShake(1, -50000)
  1282. wait(0.02)
  1283. else end
  1284. for i = 10, 0, -5 do
  1285. if Player.Character:FindFirstChild("Torso") ~= nil then
  1286. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1287. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1288. 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))
  1289. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1290. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  1291. wait()
  1292. else return false end
  1293. else return false end
  1294. end
  1295. wait(0.04)
  1296. end
  1297. if format == "reloadDual" then
  1298. for i = 0, 25, 7.5 do
  1299. if Player.Character:FindFirstChild("Torso") ~= nil then
  1300. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1301. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1302. 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)
  1303. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1304. 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)
  1305. wait()
  1306. else return false end
  1307. else return false end
  1308. end
  1309. coroutine.wrap(function()
  1310. Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1)
  1311. Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1)
  1312. for i = 0, 360, 15 do
  1313. pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
  1314. pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
  1315. wait()
  1316. end
  1317. pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end)
  1318. pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end)
  1319. end)()
  1320. if magazine.Value == 0 then
  1321. Player.Character[Name].Shell.Transparency = 1
  1322. Player.Character[Name.. " (Left)"].Shell.Transparency = 1
  1323. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
  1324. Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
  1325. else end
  1326. wait(0.1)
  1327. CamShake(1, 40000)
  1328. Player.Character[Name].Handle.Release:Play()
  1329. Player.Character[Name].Magazine.Transparency = 1
  1330. local magazineDrop = Player.Character[Name].Magazine:Clone()
  1331. magazineDrop.Transparency = 0
  1332. magazineDrop.Parent = game:GetService("Workspace")
  1333. 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)
  1334. delay(0.1, function() magazineDrop.CanCollide = true end)
  1335. wait(math.random(0.1, 0.25))
  1336. Player.Character[Name].Handle.Release:Play()
  1337. Player.Character[Name.. " (Left)"].Magazine.Transparency = 1
  1338. local magazineDropDual = Player.Character[Name.. " (Left)"].Magazine:Clone()
  1339. magazineDropDual.Transparency = 0
  1340. magazineDropDual.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), magazineDropDual)
  1342. delay(0.1, function() magazineDropDual.CanCollide = true end)
  1343. for i = 0, 25, 7.5 do
  1344. if Player.Character:FindFirstChild("Torso") ~= nil then
  1345. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1346. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1347. 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)
  1348. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1349. 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)
  1350. wait()
  1351. else return false end
  1352. else return false end
  1353. end
  1354. local magazineNew = Player.Character[Name].Magazine:Clone()
  1355. magazineNew.Name = "New Magazine"
  1356. magazineNew.Transparency = 0
  1357. magazineNew.Parent = Player.Character[Name]
  1358. local w = Instance.new("Weld")
  1359. w.Part0 = magazineNew
  1360. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  1361. w.C0 = CFrame.new(0, 1.1, 0)
  1362. w.C1 = CFrame.new()
  1363. w.Parent = magazineNew
  1364. local magazineNewL = Player.Character[Name.. " (Left)"].Magazine:Clone()
  1365. magazineNewL.Name = "New Magazine L"
  1366. magazineNewL.Transparency = 0
  1367. magazineNewL.Parent = Player.Character[Name.. " (Left)"]
  1368. local w = Instance.new("Weld")
  1369. w.Part0 = magazineNewL
  1370. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  1371. w.C0 = CFrame.new(0, 1.1, 0)
  1372. w.C1 = CFrame.new()
  1373. w.Parent = magazineNewL
  1374. for i = 125, 0, -15 do
  1375. if Player.Character:FindFirstChild("Torso") ~= nil then
  1376. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1377. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1378. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)
  1379. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1380. 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)
  1381. wait()
  1382. else return false end
  1383. else return false end
  1384. end
  1385. Player.Character[Name].Handle.Reload:Play()
  1386. Player.Character[Name].Magazine.Transparency = 0
  1387. Player.Character[Name].Shell.Transparency = 0
  1388. Player.Character[Name.. " (Left)"].Magazine.Transparency = 0
  1389. Player.Character[Name.. " (Left)"].Shell.Transparency = 0
  1390. Player.Character[Name]["New Magazine"]:Remove()
  1391. Player.Character[Name.. " (Left)"]["New Magazine L"]:Remove()
  1392. Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)
  1393. Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)
  1394. for i = 0, 125, 15 do
  1395. if Player.Character:FindFirstChild("Torso") ~= nil then
  1396. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1397. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1398. 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)
  1399. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1400. 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)
  1401. wait()
  1402. else return false end
  1403. else return false end
  1404. end
  1405. if magazine.Value == 0 then
  1406. Player.Character[Name].Handle.Lock.Pitch = 1.5
  1407. Player.Character[Name].Handle.Lock:Play()
  1408. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
  1409. Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
  1410. CamShake(1, 30000)
  1411. CamShake(1, -30000)
  1412. else end
  1413. for i = 25, 0, -5 do
  1414. if Player.Character:FindFirstChild("Torso") ~= nil then
  1415. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1416. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1417. 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)
  1418. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1419. 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)
  1420. wait()
  1421. else return false end
  1422. else return false end
  1423. end
  1424. playAnimation("rightHold")
  1425. playAnimation("leftHold")
  1426. return true
  1427. end
  1428. if format == "fire" then
  1429. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
  1430. if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
  1431. if silenced then
  1432. Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10
  1433. Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2)
  1434. Player.Character[Name].Handle.Fire2:Play()
  1435. CamShake(15, 50000)
  1436. else
  1437. Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
  1438. Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
  1439. Player.Character[Name].Handle.Fire:Play()
  1440. CamShake(15, 50000)
  1441. end
  1442. else return false end
  1443. if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
  1444. if silenced == false then
  1445. 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))
  1446. else end
  1447. else return false end
  1448. for i = 0, 10, 5 do
  1449. if Player.Character:FindFirstChild("Torso") ~= nil then
  1450. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1451. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1452. 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))
  1453. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1454. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1455. wait()
  1456. else return false end
  1457. else return false end
  1458. end
  1459. makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
  1460. if magazine.Value ~= 0 then
  1461. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
  1462. elseif magazine.Value == 0 then
  1463. Player.Character[Name].Handle.Lock.Pitch = 3
  1464. Player.Character[Name].Shell.Transparency = 1
  1465. Player.Character[Name].Handle.Lock:Play()
  1466. end
  1467. for i = 10, 0, -5 do
  1468. if Player.Character:FindFirstChild("Torso") ~= nil then
  1469. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1470. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1471. 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))
  1472. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1473. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1474. wait()
  1475. else return false end
  1476. else return false end
  1477. end
  1478. end
  1479. if format == "rightFire" then
  1480. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
  1481. if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
  1482. if silenced then
  1483. Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10
  1484. Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2)
  1485. Player.Character[Name].Handle.Fire2:Play()
  1486. CamShake(15, 50000)
  1487. else
  1488. Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
  1489. Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
  1490. Player.Character[Name].Handle.Fire:Play()
  1491. CamShake(15, 50000)
  1492. end
  1493. else return false end
  1494. if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
  1495. if silenced == false then
  1496. 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))
  1497. else end
  1498. else return false end
  1499. for i = 0, 10, 5 do
  1500. if Player.Character:FindFirstChild("Torso") ~= nil then
  1501. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1502. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1503. 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))
  1504. wait()
  1505. else return false end
  1506. else return false end
  1507. end
  1508. makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
  1509. if magazine.Value ~= 0 then
  1510. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
  1511. elseif magazine.Value == 0 then
  1512. Player.Character[Name].Handle.Lock.Pitch = 3
  1513. Player.Character[Name].Handle.Lock:Play()
  1514. Player.Character[Name].Shell.Transparency = 1
  1515. Player.Character[Name.. " (Left)"].Shell.Transparency = 1
  1516. Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
  1517. end
  1518. for i = 10, 0, -5 do
  1519. if Player.Character:FindFirstChild("Torso") ~= nil then
  1520. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1521. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1522. 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))
  1523. wait()
  1524. else return false end
  1525. else return false end
  1526. end
  1527. end
  1528. if format == "leftFire" then
  1529. Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
  1530. if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") ~= nil then
  1531. if silenced then
  1532. Player.Character[Name.. " (Left)"].Handle.Fire2.Volume = math.random(3, 8) / 10
  1533. Player.Character[Name.. " (Left)"].Handle.Fire2.Pitch = math.random(1.8, 2)
  1534. Player.Character[Name.. " (Left)"].Handle.Fire2:Play()
  1535. CamShake(15, 50000)
  1536. else
  1537. Player.Character[Name.. " (Left)"].Handle.Fire.Volume = math.random(8, 12) / 10
  1538. Player.Character[Name.. " (Left)"].Handle.Fire.Pitch = math.random(25, 35) / 20
  1539. Player.Character[Name.. " (Left)"].Handle.Fire:Play()
  1540. CamShake(15, 50000)
  1541. end
  1542. end
  1543. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") ~= nil then
  1544. if silenced == false then
  1545. 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))
  1546. else end
  1547. end
  1548. for i = 0, 10, 5 do
  1549. if Player.Character:FindFirstChild("Torso") ~= nil then
  1550. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1551. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1552. 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))
  1553. wait()
  1554. else return false end
  1555. else return false end
  1556. end
  1557. makeShell(Player.Character[Name.. " (Left)"]:FindFirstChild("ShellOut"))
  1558. if magazine.Value ~= 0 then
  1559. Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
  1560. elseif magazine.Value == 0 then
  1561. Player.Character[Name].Handle.Lock.Pitch = 3
  1562. Player.Character[Name].Handle.Lock:Play()
  1563. Player.Character[Name].Shell.Transparency = 1
  1564. Player.Character[Name.. " (Left)"].Shell.Transparency = 1
  1565. Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
  1566. end
  1567. for i = 10, 0, -5 do
  1568. if Player.Character:FindFirstChild("Torso") ~= nil then
  1569. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1570. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1571. 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))
  1572. wait()
  1573. else return false end
  1574. else return false end
  1575. end
  1576. end
  1577. if format == "whip" then
  1578. Player.Character[Name].Handle.Melee:Play()
  1579. for i = 0, 10, 5 do
  1580. if Player.Character:FindFirstChild("Torso") ~= nil then
  1581. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1582. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1583. 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))
  1584. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1585. 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)
  1586. wait()
  1587. else return false end
  1588. else return false end
  1589. end
  1590. wait(0.1)
  1591. for i = 0, 10, 5 do
  1592. if Player.Character:FindFirstChild("Torso") ~= nil then
  1593. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1594. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1595. 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)
  1596. wait()
  1597. else return false end
  1598. else return false end
  1599. end
  1600. for i = 10, 0, -5 do
  1601. if Player.Character:FindFirstChild("Torso") ~= nil then
  1602. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1603. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1604. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + i * 0.05, 0.5 + i * 0.05, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 + i * 5), 0)
  1605. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1606. 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))
  1607. wait()
  1608. else return false end
  1609. else return false end
  1610. end
  1611. if dual ~= true then
  1612. playAnimation("hold")
  1613. return true
  1614. else
  1615. playAnimation("rightHold")
  1616. playAnimation("leftHold")
  1617. return true
  1618. end
  1619. end
  1620. return true
  1621. end
  1622.  
  1623.  
  1624. function CamShake(time, freq)
  1625. coroutine.resume(coroutine.create(function()
  1626. local cam = game:GetService("Workspace").CurrentCamera
  1627. local time = 10
  1628. local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
  1629. if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
  1630. if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
  1631. 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)
  1632. for i = 1, time do
  1633. 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)
  1634. wait()
  1635. end
  1636. end))
  1637. end
  1638.  
  1639.  
  1640. function makeShell(part)
  1641. if part == nil then return false end
  1642. local casing = Instance.new("Part")
  1643. casing.Name = "Shell"
  1644. casing.formFactor = "Custom"
  1645. casing.Size = Vector3.new(0.2, 0.26, 0.2)
  1646. 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)))
  1647. casing.BrickColor = BrickColor.new("New Yeller")
  1648. local mesh = Instance.new("CylinderMesh")
  1649. mesh.Scale = Vector3.new(0.4, 1, 0.4)
  1650. mesh.Parent = casing
  1651. casing.Parent = game:GetService("Workspace")
  1652. casing:BreakJoints()
  1653. casing.Velocity = (part.CFrame.lookVector * 50) + Vector3.new(0, 10, 0)
  1654. coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
  1655. end
  1656.  
  1657.  
  1658. function Weld(x, y)
  1659. local weld = Instance.new("Weld")
  1660. weld.Part0 = x
  1661. weld.Part1 = y
  1662. CJ = CFrame.new(x.Position)
  1663. C0 = x.CFrame:inverse() * CJ
  1664. C1 = y.CFrame:inverse() * CJ
  1665. weld.C0 = C0
  1666. weld.C1 = C1
  1667. weld.Parent = x
  1668. end
  1669.  
  1670.  
  1671. function tagHumanoid(humanoid)
  1672. local tag = Instance.new("ObjectValue")
  1673. tag.Name = "creator"
  1674. tag.Value = Player
  1675. tag.Parent = humanoid
  1676. local tag = Instance.new("StringValue")
  1677. tag.Name = "creatorType1"
  1678. tag.Value = Name
  1679. tag.Parent = humanoid
  1680. local tag = Instance.new("StringValue")
  1681. tag.Name = "creatorType2"
  1682. tag.Value = "shot"
  1683. tag.Parent = humanoid
  1684. end
  1685.  
  1686.  
  1687. function untagHumanoid(humanoid)
  1688. if humanoid ~= nil then
  1689. local tag = humanoid:FindFirstChild("creator")
  1690. if tag ~= nil then
  1691. tag:Remove()
  1692. end
  1693. local tag = humanoid:FindFirstChild("creatorType1")
  1694. if tag ~= nil then
  1695. tag:Remove()
  1696. end
  1697. local tag = humanoid:FindFirstChild("creatorType2")
  1698. if tag ~= nil then
  1699. tag:Remove()
  1700. end
  1701. end
  1702. end
  1703.  
  1704.  
  1705. function fire(startPoint, endPoint, hit)
  1706. local trail = Instance.new("Part")
  1707. trail.Name = "Bullet Trail"
  1708. trail.BrickColor = BrickColor.new("Dark stone grey")
  1709. trail.TopSurface = 0
  1710. trail.BottomSurface = 0
  1711. trail.formFactor = 0
  1712. trail.Size = Vector3.new(1, 1, 1)
  1713. trail.Transparency = 0.5
  1714. trail.Anchored = true
  1715. trail.CanCollide = false
  1716. trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
  1717. trail.Parent = game:GetService("Workspace")
  1718. local mesh = Instance.new("SpecialMesh")
  1719. mesh.MeshType = "Brick"
  1720. mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude)
  1721. mesh.Parent = trail
  1722. 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)
  1723. if hit ~= nil then
  1724. if hit.Parent == nil then return end
  1725. if hit.Parent.ClassName == "Hat" then
  1726. if hit.Parent.Parent.Humanoid ~= nil then
  1727. hit.Parent.Parent.Humanoid:TakeDamage(damage * 5)
  1728. end
  1729. end
  1730. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1731. tagHumanoid(hit.Parent.Humanoid)
  1732. if hit.Name == "Head" then
  1733. hit.Parent.Humanoid:TakeDamage(damage * 10)
  1734. elseif hit.Name == "Torso" then
  1735. hit.Parent.Humanoid:TakeDamage(damage * 2)
  1736. elseif hit.Name == "Left Leg" then
  1737. hit.Parent.Humanoid:TakeDamage(damage)
  1738. hit.Parent.Humanoid.Sit = true
  1739. elseif hit.Name == "Right Leg" then
  1740. hit.Parent.Humanoid:TakeDamage(damage)
  1741. hit.Parent.Humanoid.Sit = true
  1742. else
  1743. hit.Parent.Humanoid:TakeDamage(damage)
  1744. end
  1745. if math.random(1, 10) == 1 then
  1746. hit.Parent.Humanoid.Sit = true
  1747. end
  1748. delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
  1749. end
  1750. if hit.Anchored == false then
  1751. hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2))
  1752. end
  1753. end
  1754. end
  1755.  
  1756.  
  1757. function onButton1Down(mouse)
  1758. if selected == false then return end
  1759. 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
  1760. if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
  1761. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1762. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
  1763. if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
  1764. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  1765. Button1Down = true
  1766. canFire = false
  1767. canFire2 = true
  1768. while canFire2 == true do
  1769. local humanoid = Player.Character:FindFirstChild("Humanoid")
  1770. if humanoid == nil then
  1771. canFire2 = false
  1772. break
  1773. end
  1774. if humanoid.Health <= 0 then
  1775. canFire2 = false
  1776. break
  1777. end
  1778. local fireLeft = false
  1779. if automatic == false and burst == false then
  1780. canFire2 = false
  1781. elseif automatic == false and burst == true then
  1782. if burstCount >= burstCountMax then
  1783. canFire2 = false
  1784. burstCount = 0
  1785. break
  1786. end
  1787. burstCount = burstCount + 1
  1788. elseif automatic == true and burst == false then
  1789. fireLeft = true
  1790. end
  1791. if magazine.Value > 0 then
  1792. magazine.Value = magazine.Value - 1
  1793. updateGui()
  1794. if silenced == true then
  1795. CamShake(1, Spread)
  1796. else end
  1797. fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1798. coroutine.resume(coroutine.create(function()
  1799. if dual == true then
  1800. playAnimation("rightFire")
  1801. elseif dual == false then
  1802. playAnimation("fire")
  1803. end
  1804. end))
  1805. if dual == true and magazine.Value ~= 0 then
  1806. magazine.Value = magazine.Value - 1
  1807. updateGui()
  1808. wait(math.random(0, 0.15))
  1809. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1810. coroutine.resume(coroutine.create(function()
  1811. playAnimation("leftFire")
  1812. end))
  1813. end
  1814. else
  1815. Player.Character[Name].Handle.Empty:Play()
  1816. end
  1817. if fireLeft == true and dual == true and automatic == true then
  1818. if magazine.Value > 0 then
  1819. coroutine.resume(coroutine.create(function()
  1820. wait(readyTime / 2)
  1821. magazine.Value = magazine.Value - 1
  1822. updateGui()
  1823. fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
  1824. if silenced == true then
  1825. CamShake(1, Spread)
  1826. else end
  1827. playAnimation("leftFire")
  1828. end))
  1829. else
  1830. coroutine.resume(coroutine.create(function()
  1831. wait(readyTime / 2)
  1832. Player.Character[Name].Handle.Empty:Play()
  1833. end))
  1834. end
  1835. end
  1836. wait(readyTime)
  1837. end
  1838. if magazine.Value ~= 0 then
  1839. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  1840. else end
  1841. canFire = true
  1842. end
  1843. end
  1844.  
  1845.  
  1846. function onButton1Up(mouse)
  1847. if selected == false then return end
  1848. Button1Down = false
  1849. canFire2 = false
  1850. burstCount = 0
  1851. while canFire == false do wait() end
  1852. if dual == true and automatic == false then
  1853. if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
  1854. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1855. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  1856. canFire = false
  1857. canFire2 = true
  1858. while canFire2 == true do
  1859. local humanoid = Player.Character:FindFirstChild("Humanoid")
  1860. if humanoid == nil then
  1861. canFire2 = false
  1862. break
  1863. end
  1864. if humanoid.Health <= 0 then
  1865. canFire2 = false
  1866. break
  1867. end
  1868. if burst == false then
  1869. canFire2 = false
  1870. elseif burst == true then
  1871. if burstCount >= burstCountMax then
  1872. canFire2 = false
  1873. burstCount = 0
  1874. break
  1875. end
  1876. burstCount = burstCount + 1
  1877. end
  1878. if magazine.Value <= 0 then
  1879. Player.Character[Name].Handle.Empty:Play()
  1880. else end
  1881. end
  1882. if magazine.Value ~= 0 then
  1883. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  1884. else end
  1885. canFire = true
  1886. end
  1887. end
  1888.  
  1889.  
  1890. function onKeyDown(key, mouse)
  1891. if selected == false then return end
  1892. key = key:lower()
  1893. if key == "q" and Button1Down == false and canFire == true then
  1894. if mouse.Target == nil then return end
  1895. if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
  1896. if dual == true then onKeyDown("t", mouse) end
  1897. onDeselected(mouse)
  1898. removeParts("RightHolster")
  1899. script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
  1900. end
  1901. end
  1902. if key == "e" and Button1Down == false and canFire == true and canSilence == true then
  1903. if silenced then
  1904. silenced = false
  1905. Player.Character[Name].Handle.Lock.Pitch = 5
  1906. Player.Character[Name].Handle.Lock:Play()
  1907. if Player.Character:FindFirstChild(Name) == nil then return end
  1908. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1909. if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
  1910. Player.Character[Name].Muzzle.Transparency = 1
  1911. Player.Character[Name].Silencer1.Transparency = 1
  1912. Player.Character[Name].Muzzle.Name = "Silencer"
  1913. Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
  1914. if dual == true then
  1915. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1916. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
  1917. Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
  1918. Player.Character[Name.. " (Left)"].Silencer1.Transparency = 1
  1919. Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
  1920. Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
  1921. end
  1922. else
  1923. silenced = true
  1924. Player.Character[Name].Handle.Lock.Pitch = 5
  1925. Player.Character[Name].Handle.Lock:Play()
  1926. if Player.Character:FindFirstChild(Name) == nil then return end
  1927. if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
  1928. if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
  1929. Player.Character[Name].Silencer.Transparency = 0
  1930. Player.Character[Name].Silencer1.Transparency = 0
  1931. Player.Character[Name].Muzzle.Name = "Muzzle 2"
  1932. Player.Character[Name].Silencer.Name = "Muzzle"
  1933. if dual == true then
  1934. if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
  1935. if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
  1936. Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
  1937. Player.Character[Name.. " (Left)"].Silencer1.Transparency = 0
  1938. Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
  1939. Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
  1940. end
  1941. end
  1942. end
  1943. if key == "r" and Button1Down == false and canFire == true then
  1944. if ammo.Value > 0 and magazine.Value ~= magazineMax.Value + Chamber then
  1945. canFire = false
  1946. burstCount = 0
  1947. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  1948. if magazine.Value > 0 then magazine.Value = Chamber end
  1949. updateGui()
  1950. if dual == true then
  1951. playAnimation("reloadDual")
  1952. elseif dual == false then
  1953. playAnimation("reload")
  1954. end
  1955. if ammo.Value - magazineMax.Value < 0 then
  1956. magazine.Value = ammo.Value
  1957. ammo.Value = 0
  1958. elseif ammo.Value - magazineMax.Value >= 0 then
  1959. ammo.Value = ammo.Value - magazineMax.Value
  1960. magazine.Value = magazine.Value + MagSize
  1961. end
  1962. updateGui()
  1963. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  1964. canFire = true
  1965. end
  1966. end
  1967. if key == "t" and Button1Down == false and canFire == true and canDual == true then
  1968. canFire = false
  1969. if dual == false then
  1970. local weapon = nil
  1971. for _, p in pairs(Player.Backpack:GetChildren()) do
  1972. if p.Name == Name and p ~= script.Parent then weapon = p break end
  1973. end
  1974. if weapon ~= nil then
  1975. dual = true
  1976. Chamber = 2
  1977. MagSize = MagSize * 2
  1978. weapon.Name = "Dual"
  1979. weapon.Parent = script
  1980. removeParts("RightHand")
  1981. makeParts("RightHand")
  1982. removeParts("RightHolster")
  1983. makeParts("LeftHolster")
  1984. playAnimation("leftEquip")
  1985. removeParts("LeftHolster")
  1986. makeParts("LeftHand")
  1987. magazineMax.Value = math.ceil(magazineMax.Value * 2)
  1988. ammoMax.Value = math.ceil(ammoMax.Value * 2)
  1989. magazine.Value = magazine.Value + weapon.Magazine.Value
  1990. ammo.Value = ammo.Value + weapon.Ammo.Value
  1991. updateGui()
  1992. end
  1993. elseif dual == true then
  1994. local weapon = script:FindFirstChild("Dual")
  1995. if weapon ~= nil then
  1996. dual = false
  1997. Chamber = 1
  1998. MagSize = MagSize * 0.5
  1999. weapon.Name = Name
  2000. weapon.Parent = Player.Backpack
  2001. removeParts("RightHand")
  2002. makeParts("RightHand")
  2003. playAnimation("leftUnequip")
  2004. removeParts("LeftHand")
  2005. makeParts("RightHolster")
  2006. playAnimation("hold")
  2007. weapon.Magazine.Value = math.floor(magazine.Value / 2)
  2008. weapon.Ammo.Value = math.floor(ammo.Value / 2)
  2009. magazineMax.Value = math.ceil(magazineMax.Value / 2)
  2010. ammoMax.Value = math.ceil(ammoMax.Value / 2)
  2011. magazine.Value = math.ceil(magazine.Value / 2)
  2012. ammo.Value = math.ceil(ammo.Value / 2)
  2013. updateGui()
  2014. end
  2015. end
  2016. canFire = true
  2017. end
  2018. if key == "y" and canZoom == true then
  2019. if zoom == false then
  2020. zoom = true
  2021. local pos = mouse.Hit.p
  2022. local target = mouse.Target
  2023. local cam = game:GetService("Workspace").CurrentCamera
  2024. focus = Instance.new("Part", workspace)
  2025. focus.Anchored = true
  2026. focus.CanCollide = false
  2027. focus.Transparency = 1
  2028. focus.TopSurface = 0
  2029. focus.BottomSurface = 0
  2030. focus.formFactor = "Plate"
  2031. focus.Size = Vector3.new(0, 0, 0)
  2032. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  2033. cam.CameraSubject = focus
  2034. cam.CameraType = "Attach"
  2035. while zoom == true and selected == true do
  2036. local set = false
  2037. if target ~= nil then
  2038. if target.Parent ~= nil then
  2039. if target.Anchored == false then
  2040. 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)
  2041. set = true
  2042. end
  2043. end
  2044. end
  2045. if set == false then
  2046. focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
  2047. end
  2048. wait()
  2049. end
  2050. if focus ~= nil then focus:Remove() focus = nil end
  2051. local cam = game:GetService("Workspace").CurrentCamera
  2052. cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
  2053. cam.CameraType = "Custom"
  2054. else
  2055. zoom = false
  2056. end
  2057. end
  2058. if key == "u" and Button1Down == false and canFire == true then
  2059. if automatic == false and burst == false then
  2060. if switchToBurst == true then
  2061. burst = true
  2062. local m = Instance.new("Message", Player)
  2063. m.Text = "Burst"
  2064. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2065. delay(2.5, function() m:Remove() end)
  2066. elseif switchToAutomatic == true then
  2067. automatic = true
  2068. local m = Instance.new("Message", Player)
  2069. m.Text = "Automatic"
  2070. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2071. delay(2.5, function() m:Remove() end)
  2072. end
  2073. elseif automatic == false and burst == true then
  2074. if switchToAutomatic == true then
  2075. automatic = true
  2076. burst = false
  2077. local m = Instance.new("Message", Player)
  2078. m.Text = "Automatic"
  2079. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2080. delay(2.5, function() m:Remove() end)
  2081. elseif switchToSingle == true then
  2082. burst = false
  2083. local m = Instance.new("Message", Player)
  2084. m.Text = "Single"
  2085. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2086. delay(2.5, function() m:Remove() end)
  2087. end
  2088. elseif automatic == true and burst == false then
  2089. if switchToSingle == true then
  2090. automatic = 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. elseif switchToBurst == true then
  2096. automatic = false
  2097. burst = true
  2098. local m = Instance.new("Message", Player)
  2099. m.Text = "Burst"
  2100. pcall(function() Player.Character[Name].Handle.Switch:Play() end)
  2101. delay(2.5, function() m:Remove() end)
  2102. end
  2103. end
  2104. end
  2105. if key == "f" and canFire == true then
  2106. canFire = false
  2107. canHit = true
  2108. playAnimation("whip")
  2109. canHit = false
  2110. wait(1)
  2111. canFire = true
  2112. end
  2113. end
  2114.  
  2115.  
  2116. function onSelected(mouse)
  2117. if selected == true then return end
  2118. selected = true
  2119. canFire = false
  2120. mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
  2121. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  2122. if Player.Character.WeaponActivated.Value == nil then break end
  2123. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  2124. wait()
  2125. end
  2126. updateGui()
  2127. local weapon = Instance.new("ObjectValue")
  2128. weapon.Name = "WeaponActivated"
  2129. weapon.Value = script.Parent
  2130. weapon.Parent = Player.Character
  2131. DisableLimb(1, Player.Character)
  2132. DisableLimb(2, Player.Character)
  2133. ForceAngle(1, 0, Player.Character)
  2134. ForceAngle(2, 0, Player.Character)
  2135. if dual == true then
  2136. coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
  2137. playAnimation("rightEquip")
  2138. removeParts("LeftHolster")
  2139. makeParts("LeftHand")
  2140. else
  2141. playAnimation("equip")
  2142. end
  2143. removeParts("RightHolster")
  2144. makeParts("RightHand")
  2145. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  2146. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  2147. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  2148. mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
  2149. canFire = true
  2150. end
  2151.  
  2152.  
  2153. function onDeselected(mouse)
  2154. if selected == false then return end
  2155. Button1Down = false
  2156. while canFire == false do
  2157. wait()
  2158. end
  2159. selected = false
  2160. if dual == true then
  2161. if math.random(1, 2) == 1 then
  2162. coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
  2163. wait(math.random(1, 10) / 10)
  2164. playAnimation("rightUnequip")
  2165. else
  2166. coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
  2167. wait(math.random(1, 10) / 10)
  2168. playAnimation("leftUnequip")
  2169. end
  2170. removeParts("LeftHand")
  2171. makeParts("LeftHolster")
  2172. else
  2173. playAnimation("unequip")
  2174. end
  2175. removeParts("RightHand")
  2176. makeParts("RightHolster")
  2177. ForceAngle(1, 0, Player.Character)
  2178. ForceAngle(2, 0, Player.Character)
  2179. ResetLimbCFrame(1, Player.Character)
  2180. ResetLimbCFrame(2, Player.Character)
  2181. EnableLimb(1, Player.Character)
  2182. EnableLimb(2, Player.Character)
  2183. if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
  2184. if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
  2185. if Player.Character.WeaponActivated.Value == script.Parent then
  2186. Player.Character.WeaponActivated:Remove()
  2187. end
  2188. end
  2189. while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
  2190. if Player.Character.WeaponActivated.Value == nil then break end
  2191. if Player.Character.WeaponActivated.Value.Parent == nil then break end
  2192. wait()
  2193. end
  2194. end
  2195.  
  2196.  
  2197. if script.Parent.ClassName ~= "HopperBin" then
  2198. if Player == nil then print("Error: Player not found!") return end
  2199. Tool = Instance.new("HopperBin")
  2200. Tool.Name = Name
  2201. Tool.Parent = Player.Backpack
  2202. script.Name = "Main"
  2203. script.Parent = Tool
  2204. end wait() if script.Parent.ClassName == "HopperBin" then
  2205. while script.Parent.Parent.ClassName ~= "Backpack" do
  2206. wait()
  2207. end
  2208. if script.Parent:FindFirstChild("MagazineMax") == nil then
  2209. magazineMax = Instance.new("NumberValue")
  2210. magazineMax.Name = "MagazineMax"
  2211. magazineMax.Value = 20
  2212. magazineMax.Parent = script.Parent
  2213. else
  2214. magazineMax = script.Parent.MagazineMax
  2215. end
  2216. if script.Parent:FindFirstChild("Magazine") == nil then
  2217. magazine = Instance.new("NumberValue")
  2218. magazine.Name = "Magazine"
  2219. magazine.Value = 0
  2220. magazine.Parent = script.Parent
  2221. else
  2222. magazine = script.Parent.Magazine
  2223. end
  2224. if script.Parent:FindFirstChild("AmmoMax") == nil then
  2225. ammoMax = Instance.new("NumberValue")
  2226. ammoMax.Name = "AmmoMax"
  2227. ammoMax.Value = 120
  2228. ammoMax.Parent = script.Parent
  2229. else
  2230. ammoMax = script.Parent.AmmoMax
  2231. end
  2232. if script.Parent:FindFirstChild("Ammo") == nil then
  2233. ammo = Instance.new("NumberValue")
  2234. ammo.Name = "Ammo"
  2235. ammo.Value = script.Parent.AmmoMax.Value
  2236. ammo.Parent = script.Parent
  2237. else
  2238. ammo = script.Parent.Ammo
  2239. end
  2240. Player = script.Parent.Parent.Parent
  2241. makeParts("RightHolster")
  2242. script.Parent.Selected:connect(onSelected)
  2243. script.Parent.Deselected:connect(onDeselected)
  2244. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement