Advertisement
nicholasXPG

Untitled

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