lolita5432

insanity launcher

Dec 17th, 2017
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 181.78 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. ManualWeld1 = Instance.new("ManualWeld")
  21. ManualWeld2 = Instance.new("ManualWeld")
  22. ParticleEmitter3 = Instance.new("ParticleEmitter")
  23. ParticleEmitter4 = Instance.new("ParticleEmitter")
  24. PointLight5 = Instance.new("PointLight")
  25. LocalScript6 = Instance.new("LocalScript")
  26. IntValue7 = Instance.new("IntValue")
  27. Folder8 = Instance.new("Folder")
  28. ScreenGui9 = Instance.new("ScreenGui")
  29. Frame10 = Instance.new("Frame")
  30. Frame11 = Instance.new("Frame")
  31. ImageLabel12 = Instance.new("ImageLabel")
  32. ImageLabel13 = Instance.new("ImageLabel")
  33. TextLabel14 = Instance.new("TextLabel")
  34. Frame15 = Instance.new("Frame")
  35. TextLabel16 = Instance.new("TextLabel")
  36. Frame17 = Instance.new("Frame")
  37. ImageLabel18 = Instance.new("ImageLabel")
  38. ImageLabel19 = Instance.new("ImageLabel")
  39. Frame20 = Instance.new("Frame")
  40. Frame21 = Instance.new("Frame")
  41. LocalScript22 = Instance.new("LocalScript")
  42. ImageLabel23 = Instance.new("ImageLabel")
  43. Frame24 = Instance.new("Frame")
  44. Frame25 = Instance.new("Frame")
  45. TextLabel26 = Instance.new("TextLabel")
  46. TextLabel27 = Instance.new("TextLabel")
  47. Frame28 = Instance.new("Frame")
  48. Frame29 = Instance.new("Frame")
  49. ImageLabel30 = Instance.new("ImageLabel")
  50. TextLabel31 = Instance.new("TextLabel")
  51. TextLabel32 = Instance.new("TextLabel")
  52. Frame33 = Instance.new("Frame")
  53. ImageLabel34 = Instance.new("ImageLabel")
  54. TextLabel35 = Instance.new("TextLabel")
  55. TextLabel36 = Instance.new("TextLabel")
  56. Frame37 = Instance.new("Frame")
  57. TextLabel38 = Instance.new("TextLabel")
  58. Frame39 = Instance.new("Frame")
  59. Frame40 = Instance.new("Frame")
  60. Frame41 = Instance.new("Frame")
  61. Frame42 = Instance.new("Frame")
  62. Frame43 = Instance.new("Frame")
  63. Frame44 = Instance.new("Frame")
  64. Frame45 = Instance.new("Frame")
  65. Frame46 = Instance.new("Frame")
  66. Frame47 = Instance.new("Frame")
  67. Frame48 = Instance.new("Frame")
  68. Frame49 = Instance.new("Frame")
  69. Frame50 = Instance.new("Frame")
  70. Frame51 = Instance.new("Frame")
  71. Frame52 = Instance.new("Frame")
  72. Frame53 = Instance.new("Frame")
  73. Frame54 = Instance.new("Frame")
  74. Frame55 = Instance.new("Frame")
  75. Frame56 = Instance.new("Frame")
  76. Frame57 = Instance.new("Frame")
  77. Frame58 = Instance.new("Frame")
  78. Frame59 = Instance.new("Frame")
  79. Frame60 = Instance.new("Frame")
  80. Frame61 = Instance.new("Frame")
  81. Frame62 = Instance.new("Frame")
  82. Frame63 = Instance.new("Frame")
  83. Frame64 = Instance.new("Frame")
  84. TextLabel65 = Instance.new("TextLabel")
  85. TextLabel66 = Instance.new("TextLabel")
  86. TextLabel67 = Instance.new("TextLabel")
  87. Frame68 = Instance.new("Frame")
  88. TextLabel69 = Instance.new("TextLabel")
  89. Frame70 = Instance.new("Frame")
  90. TextLabel71 = Instance.new("TextLabel")
  91. TextLabel72 = Instance.new("TextLabel")
  92. TextLabel73 = Instance.new("TextLabel")
  93. TextLabel74 = Instance.new("TextLabel")
  94. TextLabel75 = Instance.new("TextLabel")
  95. ImageLabel76 = Instance.new("ImageLabel")
  96. TextLabel77 = Instance.new("TextLabel")
  97. Frame78 = Instance.new("Frame")
  98. ImageLabel79 = Instance.new("ImageLabel")
  99. TextLabel80 = Instance.new("TextLabel")
  100. Frame81 = Instance.new("Frame")
  101. TextLabel82 = Instance.new("TextLabel")
  102. Frame83 = Instance.new("Frame")
  103. TextLabel84 = Instance.new("TextLabel")
  104. Frame85 = Instance.new("Frame")
  105. TextLabel86 = Instance.new("TextLabel")
  106. Frame87 = Instance.new("Frame")
  107. TextLabel88 = Instance.new("TextLabel")
  108. ImageLabel89 = Instance.new("ImageLabel")
  109. NumberValue90 = Instance.new("NumberValue")
  110. ManualWeld91 = Instance.new("ManualWeld")
  111. ManualWeld92 = Instance.new("ManualWeld")
  112. ManualWeld93 = Instance.new("ManualWeld")
  113. ManualWeld94 = Instance.new("ManualWeld")
  114. ManualWeld95 = Instance.new("ManualWeld")
  115. ManualWeld96 = Instance.new("ManualWeld")
  116. Script97 = Instance.new("Script")
  117. ObjectValue98 = Instance.new("ObjectValue")
  118. RemoteFunction99 = Instance.new("RemoteFunction")
  119. RemoteFunction100 = Instance.new("RemoteFunction")
  120. RemoteFunction101 = Instance.new("RemoteFunction")
  121. RemoteEvent102 = Instance.new("RemoteEvent")
  122. RemoteFunction103 = Instance.new("RemoteFunction")
  123. RemoteFunction104 = Instance.new("RemoteFunction")
  124. RemoteFunction105 = Instance.new("RemoteFunction")
  125. LocalScript106 = Instance.new("LocalScript")
  126. IntValue107 = Instance.new("IntValue")
  127. RemoteEvent108 = Instance.new("RemoteEvent")
  128. RemoteEvent109 = Instance.new("RemoteEvent")
  129. RemoteEvent110 = Instance.new("RemoteEvent")
  130. RemoteEvent111 = Instance.new("RemoteEvent")
  131. ManualWeld112 = Instance.new("ManualWeld")
  132. ManualWeld113 = Instance.new("ManualWeld")
  133. ManualWeld114 = Instance.new("ManualWeld")
  134. ManualWeld115 = Instance.new("ManualWeld")
  135. ManualWeld116 = Instance.new("ManualWeld")
  136. Part117 = Instance.new("Part")
  137. Weld118 = Instance.new("Weld")
  138. Weld119 = Instance.new("Weld")
  139. Weld120 = Instance.new("Weld")
  140. BlockMesh121 = Instance.new("BlockMesh")
  141. ManualWeld122 = Instance.new("ManualWeld")
  142. Part123 = Instance.new("Part")
  143. BlockMesh124 = Instance.new("BlockMesh")
  144. Sound125 = Instance.new("Sound")
  145. Weld126 = Instance.new("Weld")
  146. Weld127 = Instance.new("Weld")
  147. Weld128 = Instance.new("Weld")
  148. ManualWeld129 = Instance.new("ManualWeld")
  149. ManualWeld130 = Instance.new("ManualWeld")
  150. IntValue131 = Instance.new("IntValue")
  151. ManualWeld132 = Instance.new("ManualWeld")
  152. IntValue133 = Instance.new("IntValue")
  153. IntValue134 = Instance.new("IntValue")
  154. ManualWeld135 = Instance.new("ManualWeld")
  155. ManualWeld136 = Instance.new("ManualWeld")
  156. Tool0.Name = "Insanity"
  157. Tool0.Parent = mas
  158. Tool0.TextureId = "http://www.roblox.com/asset/?id=77444324"
  159. Tool0.GripForward = Vector3.new(-0.191044495, 0.0976709872, -0.976709962)
  160. Tool0.GripPos = Vector3.new(-0.200000003, -0.300000012, 0.300000012)
  161. Tool0.GripRight = Vector3.new(0.98158133, 0.0190096367, -0.190096363)
  162. Tool0.GripUp = Vector3.new(0, 0.995037258, 0.0995037258)
  163. ManualWeld1.Name = "BoltBack-to-Bolt Strong Joint"
  164. ManualWeld1.Parent = mas
  165. ManualWeld1.C0 = CFrame.new(-0.450000018, 0.0100000892, 0.25, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  166. ManualWeld1.C1 = CFrame.new(0.450003594, 0.0100708008, -0.249998927, 0.999999166, 7.22828054e-06, -8.8044224e-05, 8.78973151e-05, 0.000205219825, 0.999999464, 9.66867265e-06, -0.999997675, 0.000210978149)
  167. ManualWeld1.Part0 = nil
  168. ManualWeld1.Part1 = nil
  169. ManualWeld2.Name = "BoltBack-to-Bolt Strong Joint"
  170. ManualWeld2.Parent = mas
  171. ManualWeld2.C0 = CFrame.new(0.450000018, -0.0100000892, 0.25, 1, 0, 0, 0, 0, -1, 0, 1, 0)
  172. ManualWeld2.C1 = CFrame.new(0.450000823, -0.0100708008, 0.250036597, 1, -2.19845751e-05, -4.36113027e-07, -4.35721603e-07, 1.78050032e-05, -1, 2.19845842e-05, 1, 1.78049941e-05)
  173. ManualWeld2.Part0 = nil
  174. ManualWeld2.Part1 = nil
  175. ParticleEmitter3.Name = "1FlashFX[Smoke]"
  176. ParticleEmitter3.Parent = mas
  177. ParticleEmitter3.Transparency = NumberSequence.new(0.60000002384186,1)
  178. ParticleEmitter3.Rotation = NumberRange.new(0, 360)
  179. ParticleEmitter3.Size = NumberSequence.new(0.99999964237213,3)
  180. ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
  181. ParticleEmitter3.Enabled = false
  182. ParticleEmitter3.LightEmission = 0.10000000149012
  183. ParticleEmitter3.Texture = "http://www.roblox.com/asset/?id=244514423"
  184. ParticleEmitter3.Lifetime = NumberRange.new(1.25, 1.5)
  185. ParticleEmitter3.Rate = 100
  186. ParticleEmitter3.RotSpeed = NumberRange.new(10, 10)
  187. ParticleEmitter3.Speed = NumberRange.new(5, 7)
  188. ParticleEmitter3.VelocitySpread = 15
  189. ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
  190. ParticleEmitter4.Name = "FlashFX[Flash]"
  191. ParticleEmitter4.Parent = mas
  192. ParticleEmitter4.Transparency = NumberSequence.new(0.75,1)
  193. ParticleEmitter4.Rotation = NumberRange.new(0, 90)
  194. ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
  195. ParticleEmitter4.Enabled = false
  196. ParticleEmitter4.LightEmission = 1
  197. ParticleEmitter4.Texture = "http://www.roblox.com/asset/?id=3419963"
  198. ParticleEmitter4.Lifetime = NumberRange.new(0.10000000149012, 0.10000000149012)
  199. ParticleEmitter4.Rate = 1000
  200. ParticleEmitter4.Speed = NumberRange.new(50, 50)
  201. ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
  202. PointLight5.Name = "FlashFX[Light]"
  203. PointLight5.Parent = mas
  204. PointLight5.Color = Color3.new(1, 1, 0.498039)
  205. PointLight5.Enabled = false
  206. PointLight5.Brightness = 10
  207. PointLight5.Range = 6
  208. PointLight5.Shadows = true
  209. PointLight5.Color = Color3.new(1, 1, 0.498039)
  210. LocalScript6.Name = "clientMain"
  211. LocalScript6.Parent = Tool0
  212. table.insert(cors,sandbox(LocalScript6,function()
  213. --[[
  214. Kit By TurboFusion
  215. Remake By MuYhEt & Xander521
  216. --]]
  217. --------------------------------------------------------------------------------------
  218. --------------------[ CHARACTER LOADING ]---------------------------------------------
  219. --------------------------------------------------------------------------------------
  220.  
  221. repeat wait() until game.Players.LocalPlayer.Character
  222. repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace)
  223. wait(1 / 20)
  224.  
  225. --------------------------------------------------------------------------------------
  226. --------------------[ IGNORE MODEL ]--------------------------------------------------
  227. --------------------------------------------------------------------------------------
  228.  
  229. local ignoreCode = script:WaitForChild("ignoreCode")
  230.  
  231. repeat wait() until ignoreCode.Value ~= 0
  232.  
  233. local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
  234.  
  235. local grenadeFolder = ignoreModel:WaitForChild("grenadeFolder")
  236.  
  237. --------------------------------------------------------------------------------------
  238. --------------------[ CONSTANTS ]-----------------------------------------------------
  239. --------------------------------------------------------------------------------------
  240.  
  241. local Gun = script.Parent
  242. local serverMain = Gun:WaitForChild("serverMain")
  243. local Handle = Gun:WaitForChild("Handle")
  244. local AimPart = Gun:WaitForChild("AimPart")
  245. local Main = Gun:WaitForChild("Main")
  246.  
  247. local Ammo = Gun:WaitForChild("Ammo")
  248. local ClipSize = Gun:WaitForChild("ClipSize")
  249. local StoredAmmo = Gun:WaitForChild("StoredAmmo")
  250.  
  251. local createTweenIndicator = serverMain:WaitForChild("createTweenIndicator")
  252. local deleteTweenIndicator = serverMain:WaitForChild("deleteTweenIndicator")
  253. local getWeldCF = serverMain:WaitForChild("getWeldCF")
  254. local gunSetup = serverMain:WaitForChild("gunSetup")
  255. local lerpCF = serverMain:WaitForChild("lerpCF")
  256. local createBlood = serverMain:WaitForChild("createBlood")
  257. local createBulletImpact = serverMain:WaitForChild("createBulletImpact")
  258. local createShockwave = serverMain:WaitForChild("createShockwave")
  259. local createTrail = serverMain:WaitForChild("createTrail")
  260.  
  261. local Particle = require(script:WaitForChild("Particle"))
  262. local Spring = require(script:WaitForChild("Spring"))
  263. local Anims = require(Gun:WaitForChild("ANIMATIONS"))
  264. local Plugins = require(Gun:WaitForChild("PLUGINS"))
  265. local S = require(Gun:WaitForChild("SETTINGS"))
  266.  
  267. local Player = game.Players.LocalPlayer
  268. local Char = Player.Character
  269. local Humanoid = Char:WaitForChild("Humanoid")
  270. local Torso = Char:WaitForChild("Torso")
  271. local Head = Char:WaitForChild("Head")
  272. local HRP = Char:WaitForChild("HumanoidRootPart")
  273. local Root = HRP:WaitForChild("RootJoint")
  274.  
  275. local Neck = Torso:WaitForChild("Neck")
  276.  
  277. local LArm = Char:WaitForChild("Left Arm")
  278. local RArm = Char:WaitForChild("Right Arm")
  279. local LLeg = Char:WaitForChild("Left Leg")
  280. local RLeg = Char:WaitForChild("Right Leg")
  281.  
  282. local M2 = Player:GetMouse()
  283.  
  284. local mainGUI = script:WaitForChild("mainGUI")
  285.  
  286. local crossHair = mainGUI:WaitForChild("crossHair")
  287. local HUD = mainGUI:WaitForChild("HUD")
  288. local Scope = mainGUI:WaitForChild("Scope")
  289. local fireSelect = mainGUI:WaitForChild("fireSelect")
  290. local hitMarker = mainGUI:WaitForChild("hitMarker")
  291. local Sens = mainGUI:WaitForChild("Sens")
  292.  
  293. local crossA = crossHair:WaitForChild("A"):WaitForChild("Line")
  294. local crossB = crossHair:WaitForChild("B"):WaitForChild("Line")
  295. local crossC = crossHair:WaitForChild("C"):WaitForChild("Line")
  296. local crossD = crossHair:WaitForChild("D"):WaitForChild("Line")
  297.  
  298. local Controls = HUD:WaitForChild("Controls")
  299.  
  300. local gunNameTitle = HUD:WaitForChild("gunName"):WaitForChild("Title")
  301.  
  302. local scopeMain = Scope:WaitForChild("Main")
  303. local scopeSteady = Scope:WaitForChild("Steady")
  304.  
  305. local fireModes = fireSelect:WaitForChild("Modes")
  306.  
  307. local modeGUI = HUD:WaitForChild("Mode"):WaitForChild("Main")
  308. local clipAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
  309. local storedAmmoGUI = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
  310.  
  311. local DS = game:GetService("Debris")
  312. local CP = game:GetService("ContentProvider")
  313. local RS = game:GetService("RunService")
  314. local UIS = game:GetService("UserInputService")
  315.  
  316. local Cam = game.Workspace.CurrentCamera
  317.  
  318. local ABS, HUGE, FLOOR, CEIL = math.abs, math.huge, math.floor, math.ceil
  319. local RAD, SIN, COS, TAN = math.rad, math.sin, math.cos, math.tan
  320. local VEC2, V3 = Vector2.new, Vector3.new
  321. local CF, CFANG = CFrame.new, CFrame.Angles
  322. local INSERT = table.insert
  323.  
  324. local maxStamina = S.sprintTime * 60
  325. local maxSteadyTime = S.scopeSettings.steadyTime * 60
  326.  
  327. local LethalIcons = {
  328. "http://www.roblox.com/asset/?id=194849880";
  329. "http://www.roblox.com/asset/?id=195727791";
  330. "http://www.roblox.com/asset/?id=195728137";
  331. "http://www.roblox.com/asset/?id=218151830";
  332. }
  333.  
  334. local TacticalIcons = {
  335. "http://www.roblox.com/asset/?id=195728473";
  336. "http://www.roblox.com/asset/?id=195728693";
  337. }
  338.  
  339. local ASCII = {
  340. 071; 117; 110; 032;
  341. 075; 105; 116; 032;
  342. 115; 099; 114; 105;
  343. 112; 116; 101; 100;
  344. 032; 098; 121; 032;
  345. 084; 117; 114; 098;
  346. 111; 070; 117; 115;
  347. 105; 111; 110; 000;
  348. }
  349.  
  350. local Ignore = {
  351. Char;
  352. ignoreModel;
  353. }
  354.  
  355. local Shoulders = {
  356. Right = Torso:WaitForChild("Right Shoulder");
  357. Left = Torso:WaitForChild("Left Shoulder")
  358. }
  359.  
  360. local armC0 = {
  361. CF(-1.5, 0, 0) * CFANG(RAD(90), 0, 0);
  362. CF(1.5, 0, 0) * CFANG(RAD(90), 0, 0);
  363. }
  364.  
  365. local legC0 = {
  366. Stand = {
  367. CF(-0.5, -2, 0);
  368. CF(0.5, -2, 0);
  369. };
  370. Crouch = {
  371. CF(-0.5, -1.5, 0.5) * CFANG(-RAD(90), 0, 0);
  372. CF(0.5, -1, -0.75);
  373. };
  374. Prone = {
  375. CF(-0.5, -2, 0);
  376. CF(0.5, -2, 0);
  377. };
  378. }
  379.  
  380. local Sine = function(X)
  381. return SIN(RAD(X))
  382. end
  383.  
  384. local Linear = function(X)
  385. return (X / 90)
  386. end
  387.  
  388. --------------------------------------------------------------------------------------
  389. --------------------[ VARIABLES ]-----------------------------------------------------
  390. --------------------------------------------------------------------------------------
  391.  
  392. local Selected = false
  393.  
  394. local playerMass = 0
  395.  
  396. local Forward = false
  397. local Backward = false
  398.  
  399. local Idling = false
  400. local Walking = false
  401. local Running = false
  402.  
  403. local crawlCamRot = 0
  404. local crawlAlpha = 0
  405. local idleAlpha = 1
  406. local walkAlpha = 0
  407. local isCrawling = false
  408. local isIdling = false
  409. local isWalking = false
  410. local isRunning = false
  411.  
  412. local Aimed = false
  413. local Aiming = false
  414. local aimAlpha = 0
  415. local headOffset = VEC2(COS(RAD(90) - S.aimSettings.headTilt) * 0.5, 1 + SIN(RAD(90) - S.aimSettings.headTilt) * 0.5)
  416.  
  417. local Reloading = false
  418. local breakReload = false
  419. local magVisible = true
  420. local newMag = false
  421.  
  422. local Knifing = false
  423.  
  424. local MB1Down = false
  425. local Firing = false
  426. local canFire = true
  427. local fireFunction = nil
  428. local firstShot = false
  429. local shotCount = 0
  430. local lastSideRecoil = {0, 0}
  431. local recoilAnim = {
  432. Pos = V3();
  433. Rot = V3();
  434. Code = nil;
  435. }
  436.  
  437. local numModes = 0
  438. local rawFireMode = 1
  439. local canSelectFire = true
  440. local guiAngOffset = 0
  441. local Modes = {}
  442.  
  443. local onGround = true
  444. local startFallHeight = 0
  445. local jumpAnim = {
  446. Pos = 0;
  447. Rot = 0;
  448. Code = 0;
  449. }
  450.  
  451. local runReady = true
  452. local runKeyPressed = false
  453. local chargingStamina = false
  454.  
  455. local AimingIn = false
  456. local AimingOut = false
  457.  
  458. local Stamina = S.sprintTime * 60
  459. local currentSteadyTime = S.scopeSettings.steadyTime * 60
  460.  
  461. local camSteady = false
  462. local takingBreath = false
  463. local steadyKeyPressed = false
  464.  
  465. local Grip = nil
  466. local aimedGripCF = nil
  467.  
  468. local spreadZoom = "unAimed"
  469. local spreadStance = "Stand"
  470. local spreadMotion = "Idling"
  471. local baseSpread = S.spreadSettings.unAimed.Stand.Idling
  472. local currentSpread = 0
  473. local loweringSpread = false
  474.  
  475. local mouseSensitivity = S.sensitivitySettings.Default
  476. local aimSensitivity = S.sensitivitySettings.Aim
  477. local lastSensUpdate = 0
  478.  
  479. local ammoInClip = 0
  480.  
  481. local Stance = 0
  482. local stanceSway = 1
  483. local camSway = 1
  484.  
  485. local camAng = VEC2()
  486.  
  487. local armTilt = 0
  488. local moveAng = 0
  489. local animCode = 0
  490.  
  491. local desiredXOffset = 0
  492. local desiredYOffset = 0
  493. local currentXOffset = 0
  494. local currentYOffset = 0
  495. local aimHeadOffset = 0
  496. local recoilAnimMultiplier = 1
  497. local jumpAnimMultiplier = 1
  498. local translationDivisor = 7
  499. local rotationMultiplier = S.momentumSettings.Amplitude.unAimed
  500. local armTiltMultiplier = 1
  501.  
  502. local equipAnimPlaying = false
  503.  
  504. local crossOffset = 0
  505.  
  506. local camOffsets = {
  507. guiScope = {
  508. Rot = V3();
  509. };
  510. Reload = {
  511. Rot = V3();
  512. Code = nil;
  513. };
  514. Recoil = {
  515. Rot = V3();
  516. Code = nil;
  517. };
  518. }
  519.  
  520. local Anim = {
  521. Pos = V3();
  522. Rot = V3();
  523. Ang = 0;
  524. Code = 0;
  525. }
  526.  
  527. local lastBeat = 0
  528.  
  529. local gunParts = {}
  530.  
  531. local Connections = {}
  532.  
  533. local Keys = {}
  534.  
  535. --------------------------------------------------------------------------------------
  536. --------------------[ PRE-LOADING ]---------------------------------------------------
  537. --------------------------------------------------------------------------------------
  538.  
  539. CP:Preload(S.explosionSettings.soundId)
  540. CP:Preload(S.holeSettings.Texture)
  541. CP:Preload(S.sparkSettings.Texture)
  542. CP:Preload(S.smokeSettings.Texture)
  543. CP:Preload(S.bloodSettings.Texture)
  544. CP:Preload("http://www.roblox.com/asset/?id=126877530") --The dark green arrow in the select fire gui
  545. CP:Preload("http://www.roblox.com/asset/?id=55754953") --The circle in the select fire gui
  546.  
  547. --------------------------------------------------------------------------------------
  548. --------------------[ GUN SETUP ]-----------------------------------------------------
  549. --------------------------------------------------------------------------------------
  550.  
  551. serverMain:WaitForChild("Plyr").Value = Player
  552.  
  553. local gunMomentum = Spring.new(V3())
  554. gunMomentum.s = S.momentumSettings.Speed
  555. gunMomentum.d = S.momentumSettings.Damper
  556.  
  557. local gunRecoilSpring = Spring.new(V3())
  558. gunRecoilSpring.s = S.recoilSettings.springSpeed
  559. gunRecoilSpring.d = S.recoilSettings.springDamper
  560.  
  561. local camRecoilSpring = Spring.new(V3())
  562. camRecoilSpring.s = 35
  563. camRecoilSpring.d = 0.5
  564.  
  565. local crossSpring = Spring.new(V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0))
  566. crossSpring.s = 20
  567. crossSpring.d = 0.75
  568.  
  569. --[[local function getModelMass(P)
  570. for _, v in pairs(P:GetChildren()) do
  571. if v:IsA("BasePart") then
  572. playerMass = playerMass + v:GetMass()
  573. end
  574. getModelMass(v)
  575. end
  576. end
  577. getModelMass(Char)
  578.  
  579. Char.DescendantAdded:connect(function(Descendant)
  580. if Descendant:IsA("BasePart") then
  581. playerMass = playerMass + Descendant:GetMass()
  582. end
  583. end)
  584. Char.DescendantRemoving:connect(function(Descendant)
  585. if Descendant:IsA("BasePart") then
  586. playerMass = playerMass - Descendant:GetMass()
  587. end
  588. end)]]
  589.  
  590. --------------------------------------------------------------------------------------
  591. --------------------[ WELD CFRAMES ]--------------------------------------------------
  592. --------------------------------------------------------------------------------------
  593.  
  594. spawn(function()
  595. --[[for _, v in pairs(Gun:GetChildren()) do
  596. if v:IsA("BasePart") and v ~= Handle then
  597. if v:FindFirstChild("mainWeld") then v.mainWeld:Destroy() end
  598. if (not v:FindFirstChild("weldCF")) then
  599. local weldCF = Instance.new("CFrameValue")
  600. weldCF.Name = "weldCF"
  601. weldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
  602. weldCF.Parent = v
  603. INSERT(gunParts, {Obj = v, Weld = nil})
  604. end
  605. if string.sub(v.Name, 1, 3) == "Mag" then
  606. if (not v:FindFirstChild("magTrans")) then
  607. local magTrans = Instance.new("NumberValue")
  608. magTrans.Name = "magTrans"
  609. magTrans.Value = v.Transparency
  610. magTrans.Parent = v
  611. end
  612. end
  613. v.Anchored = false
  614. end
  615. end
  616. Handle.Anchored = false]]
  617. for _, v in pairs(Gun:GetChildren()) do
  618. if v:FindFirstChild("weldCF") then
  619. INSERT(gunParts, {Obj = v, Weld = nil})
  620. v.Anchored = false
  621. end
  622. end
  623. end)
  624.  
  625. --------------------------------------------------------------------------------------
  626. --------------------[ MAIN PROGRAM ]--------------------------------------------------
  627. --------------------------------------------------------------------------------------
  628.  
  629. --------------------[ ARM CREATION FUNCTION ]-----------------------------------------
  630.  
  631. function createArms()
  632. local Arms = {}
  633. for i = 0, 1 do
  634. local armModel = Instance.new("Model")
  635. armModel.Name = "armModel"
  636.  
  637. local Arm = Instance.new("Part")
  638. Arm.BrickColor = (S.fakeArmSettings.realBodyColor and (i == 0 and LArm.BrickColor or RArm.BrickColor) or S.fakeArmSettings.Color)
  639. Arm.Transparency = S.fakeArmSettings.Transparency
  640. Arm.Name = "Arm"
  641. Arm.CanCollide = false
  642. Arm.Size = V3(0.598, 2, 0.598)
  643. Arm.Parent = armModel
  644. local armMesh = Instance.new("SpecialMesh")
  645. armMesh.MeshId = "rbxasset://fonts//leftarm.mesh"
  646. armMesh.MeshType = Enum.MeshType.FileMesh
  647. armMesh.Scale = V3(0.598, 1, 0.598)
  648. armMesh.Parent = Arm
  649.  
  650. local Glove1 = Instance.new("Part")
  651. Glove1.BrickColor = BrickColor.new("Black")
  652. Glove1.Name = "Glove1"
  653. Glove1.CanCollide = false
  654. Glove1.Size = V3(0.598, 2, 0.598)
  655. Glove1.Parent = armModel
  656. local glove1Mesh = Instance.new("SpecialMesh")
  657. glove1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
  658. glove1Mesh.Offset = V3(0, -0.5, 0)
  659. glove1Mesh.Scale = V3(0.658, 0.205, 0.658)
  660. glove1Mesh.Parent = Glove1
  661. local glove1Weld = Instance.new("Weld")
  662. glove1Weld.Part0 = Arm
  663. glove1Weld.Part1 = Glove1
  664. glove1Weld.Parent = Arm
  665.  
  666. local Glove2 = Instance.new("Part")
  667. Glove2.BrickColor = BrickColor.new("Black")
  668. Glove2.Name = "Glove2"
  669. Glove2.CanCollide = false
  670. Glove2.Size = V3(0.598, 2, 0.598)
  671. Glove2.Parent = armModel
  672. local glove2Mesh = Instance.new("SpecialMesh")
  673. glove2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
  674. glove2Mesh.Offset = V3(0, -0.435, 0)
  675. glove2Mesh.Scale = V3(0.69, 0.105, 0.69)
  676. glove2Mesh.Parent = Glove2
  677. local glove2Weld = Instance.new("Weld")
  678. glove2Weld.Part0 = Arm
  679. glove2Weld.Part1 = Glove2
  680. glove2Weld.Parent = Arm
  681.  
  682. local Glove3 = Instance.new("Part")
  683. Glove3.BrickColor = BrickColor.new("Black")
  684. Glove3.Name = "Glove3"
  685. Glove3.CanCollide = false
  686. Glove3.Size = V3(0.598, 2, 0.598)
  687. Glove3.Parent = armModel
  688. local glove3Mesh = Instance.new("SpecialMesh")
  689. glove3Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
  690. glove3Mesh.Offset = V3(0.18 * ((i * 2) - 1), -0.7, 0)
  691. glove3Mesh.Scale = V3(0.299, 0.305, 0.657)
  692. glove3Mesh.Parent = Glove3
  693. local glove3Weld = Instance.new("Weld")
  694. glove3Weld.Part0 = Arm
  695. glove3Weld.Part1 = Glove3
  696. glove3Weld.Parent = Arm
  697.  
  698. local Sleeve1 = Instance.new("Part")
  699. Sleeve1.BrickColor = BrickColor.new("Sand green")
  700. Sleeve1.Name = "Sleeve1"
  701. Sleeve1.CanCollide = false
  702. Sleeve1.Size = V3(0.598, 2, 0.598)
  703. Sleeve1.Parent = armModel
  704. local sleeve1Mesh = Instance.new("SpecialMesh")
  705. sleeve1Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
  706. sleeve1Mesh.Offset = V3(0, 0.75, 0)
  707. sleeve1Mesh.Scale = V3(0.656, 0.3, 0.656)
  708. sleeve1Mesh.Parent = Sleeve1
  709. local sleeve1Weld = Instance.new("Weld")
  710. sleeve1Weld.Part0 = Arm
  711. sleeve1Weld.Part1 = Sleeve1
  712. sleeve1Weld.Parent = Arm
  713.  
  714. local Sleeve2 = Instance.new("Part")
  715. Sleeve2.BrickColor = BrickColor.new("Sand green")
  716. Sleeve2.Name = "Sleeve2"
  717. Sleeve2.CanCollide = false
  718. Sleeve2.Size = V3(0.598, 2, 0.598)
  719. Sleeve2.Parent = armModel
  720. local sleeve2Mesh = Instance.new("SpecialMesh")
  721. sleeve2Mesh.MeshId = "rbxasset://fonts//leftarm.mesh"
  722. sleeve2Mesh.Offset = V3(0, 0.55, 0)
  723. sleeve2Mesh.Scale = V3(0.75, 0.1, 0.75)
  724. sleeve2Mesh.Parent = Sleeve2
  725. local sleeve2Weld = Instance.new("Weld")
  726. sleeve2Weld.Part0 = Arm
  727. sleeve2Weld.Part1 = Sleeve2
  728. sleeve2Weld.Parent = Arm
  729.  
  730. table.insert(Arms, {Model = armModel, armPart = Arm})
  731. end
  732. return Arms
  733. end
  734.  
  735. --------------------[ MATH FUNCTIONS ]------------------------------------------------
  736.  
  737. function Map(Val, fromLow, fromHigh, toLow, toHigh)
  738. return (Val - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow
  739. end
  740.  
  741. function numLerp(A, B, Alpha)
  742. return A + (B - A) * Alpha
  743. end
  744.  
  745. function RAND(Min, Max, Accuracy)
  746. return numLerp(Min, Max, math.random())
  747. --[[local Inverse = 1 / (Accuracy or 1)
  748. return (math.random(Min * Inverse, Max * Inverse) / Inverse)]]
  749. end
  750.  
  751. function Round(Num, toNearest)
  752. return math.floor(Num / toNearest + 0.5) * toNearest
  753. end
  754.  
  755. function getNearestPoint(A, B, Origin)
  756. local A2 = (A - Origin).magnitude
  757. local B2 = (B - Origin).magnitude
  758. return (math.min(A2, B2) == A2 and A or B)
  759. end
  760.  
  761. --------------------[ TWEEN FUNCTIONS ]-----------------------------------------------
  762.  
  763. function tweenJoint(Joint, newC0, newC1, Alpha, Duration)
  764. spawn(function()
  765. local newCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
  766. local tweenIndicator = nil
  767. if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
  768. tweenIndicator = Instance.new("IntValue")
  769. tweenIndicator.Name = "tweenCode"
  770. tweenIndicator.Value = newCode
  771. tweenIndicator.Parent = Joint
  772. else
  773. tweenIndicator = Joint.tweenCode
  774. tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
  775. end
  776. --local tweenIndicator = createTweenIndicator:InvokeServer(Joint, newCode)
  777. if Duration <= 0 then --If the duration is less than or equal to 0 then there's no need for a tweening loop
  778. if newC0 then Joint.C0 = newC0 end
  779. if newC1 then Joint.C1 = newC1 end
  780. else
  781. local startC0 = Joint.C0
  782. local startC1 = Joint.C1
  783. local t0 = tick()
  784. while true do
  785. RS.RenderStepped:wait() --This makes the for loop step every 1/60th of a second
  786. local X = math.min((tick() - t0) / Duration, 1) * 90
  787. if tweenIndicator.Value ~= newCode then break end --This makes sure that another tween wasn't called on the same joint
  788. if (not Selected) then break end --This stops the tween if the tool is deselected
  789. if newC0 then Joint.C0 = startC0:lerp(newC0, Alpha(X)) end
  790. if newC1 then Joint.C1 = startC1:lerp(newC1, Alpha(X)) end
  791. --if newC0 then lerpCF:InvokeServer(Joint, "C0", startC0, newC0, Alpha(X)) end
  792. --if newC1 then lerpCF:InvokeServer(Joint, "C1", startC1, newC1, Alpha(X)) end
  793. if X == 90 then break end
  794. end
  795. end
  796. if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
  797. tweenIndicator:Destroy()
  798. end
  799. --deleteTweenIndicator:InvokeServer(tweenIndicator, newCode)
  800. end)
  801. end
  802.  
  803. function tweenCam(Key, newRot, Alpha, Duration)
  804. spawn(function()
  805. local newCode = math.random(-1e9, 1e9)
  806. camOffsets[Key].Code = newCode
  807.  
  808. local Increment = 1.5 / Duration
  809. local prevRot = camOffsets[Key].Rot
  810. local X = 0
  811. while true do
  812. RS.RenderStepped:wait()
  813. local newX = X + Increment
  814. X = (newX > 90 and 90 or newX)
  815. if camOffsets[Key].Code ~= newCode then break end
  816. if (not Selected) then break end
  817.  
  818. camOffsets[Key].Rot = prevRot:lerp(newRot, Alpha(X))
  819.  
  820. if X == 90 then break end
  821. end
  822.  
  823. if camOffsets[Key].Code == newCode then
  824. camOffsets[Key].Code = nil
  825. end
  826. end)
  827. end
  828.  
  829. function tweenRecoil(newPos, newRot, Alpha, Duration)
  830. spawn(function()
  831. local newCode = math.random(-1e9, 1e9)
  832. recoilAnim.Code = newCode
  833.  
  834. local Increment = 1.5 / Duration
  835. local prevPos = recoilAnim.Pos
  836. local prevRot = recoilAnim.Rot
  837. local X = 0
  838. while true do
  839. RS.RenderStepped:wait()
  840. local newX = X + Increment
  841. X = (newX > 90 and 90 or newX)
  842. if recoilAnim.Code ~= newCode then break end
  843. if (not Selected) then break end
  844.  
  845. recoilAnim.Pos = prevPos:lerp(newPos, Alpha(X))
  846. recoilAnim.Rot = prevRot:lerp(newRot, Alpha(X))
  847.  
  848. if X == 90 then break end
  849. end
  850.  
  851. if recoilAnim.Code == newCode then
  852. recoilAnim.Code = nil
  853. end
  854. end)
  855. end
  856.  
  857. --------------------[ GUI UPDATE FUNCTIONS ]------------------------------------------
  858.  
  859. local function updateClipAmmo()
  860. clipAmmoGUI.Text = Ammo.Value
  861. clipAmmoGUI.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
  862. end
  863.  
  864. local function updateStoredAmmo()
  865. storedAmmoGUI.Text = StoredAmmo.Value
  866. storedAmmoGUI.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
  867. end
  868.  
  869. local function updateHealth()
  870. HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
  871. HUD.Health.Num.TextColor3 = (
  872. (Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
  873. (Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
  874. (Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
  875. )
  876. end
  877.  
  878. local function updateModeLabels(prevState, newState, X)
  879. for Num, Mode in pairs(fireModes:GetChildren()) do
  880. local guiAngOffset2 = guiAngOffset + 90
  881. local Ang = numLerp(
  882. (guiAngOffset2 * prevState) - (guiAngOffset2 * Num) - guiAngOffset2,
  883. (guiAngOffset2 * newState) - (guiAngOffset2 * Num) - guiAngOffset2,
  884. Sine(X)
  885. ) + guiAngOffset
  886. local XPos = COS(RAD(Ang))
  887. local YPos = SIN(RAD(Ang))
  888. Mode.Position = UDim2.new(0.5, XPos * 100, 0.5, YPos * 100)
  889.  
  890. local R = COS(math.atan2(Mode.Position.Y.Offset, Mode.Position.X.Offset) + RAD(90))
  891. Mode.Label.TextTransparency = 1 - ((R / 4) + 0.75)
  892.  
  893. local Scale = (R * 10) + 50
  894. Mode.Label.Position = UDim2.new(0, -Scale / 2, 0, 0)
  895. Mode.Label.Size = UDim2.new(0, Scale, 0, Scale / 2)
  896. end
  897. end
  898.  
  899. --------------------[ GUI SETUP FUNCTION ]--------------------------------------------
  900.  
  901. function convertKey(Key)
  902. if Key == string.char(8) then
  903. return "BKSPCE"
  904. elseif Key == string.char(9) then
  905. return "TAB"
  906. elseif Key == string.char(13) then
  907. return "ENTER"
  908. elseif Key == string.char(17) then
  909. return "UP"
  910. elseif Key == string.char(18) then
  911. return "DOWN"
  912. elseif Key == string.char(19) then
  913. return "RIGHT"
  914. elseif Key == string.char(20) then
  915. return "LEFT"
  916. elseif Key == string.char(22) then
  917. return "HOME"
  918. elseif Key == string.char(23) then
  919. return "END"
  920. elseif Key == string.char(27) then
  921. return "F2"
  922. elseif Key == string.char(29) then
  923. return "F4"
  924. elseif Key == string.char(30) then
  925. return "F5"
  926. elseif Key == string.char(32) or Key == " " then
  927. return "F7"
  928. elseif Key == string.char(33) or Key == "!" then
  929. return "F8"
  930. elseif Key == string.char(34) or Key == '"' then
  931. return "F9"
  932. elseif Key == string.char(35) or Key == "#" then
  933. return "F10"
  934. elseif Key == string.char(37) or Key == "%" then
  935. return "F12"
  936. elseif Key == string.char(47) or Key == "/" then
  937. return "R-SHIFT"
  938. elseif Key == string.char(48) or Key == "0" then
  939. return "L-SHIFT"
  940. elseif Key == string.char(49) or Key == "1" then
  941. return "R-CTRL"
  942. elseif Key == string.char(50) or Key == "2" then
  943. return "L-CTRL"
  944. elseif Key == string.char(51) or Key == "3" then
  945. return "R-ALT"
  946. elseif Key == string.char(52) or Key == "4" then
  947. return "L-ALT"
  948. else
  949. return string.upper(Key)
  950. end
  951. end
  952.  
  953. function createControlFrame(Key, Desc, Num)
  954. local C = Instance.new("Frame")
  955. C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
  956. C.BorderSizePixel = 0
  957. C.Name = "C"..Num
  958. C.Position = UDim2.new(0, 0, 0, Num * 20)
  959. C.Size = UDim2.new(1, 0, 0, 20)
  960. C.ZIndex = 10
  961.  
  962. local K = Instance.new("TextLabel")
  963. K.BackgroundTransparency = 1
  964. K.Name = "Key"
  965. K.Size = UDim2.new(0, 45, 1, 0)
  966. K.ZIndex = 10
  967. K.Font = Enum.Font.ArialBold
  968. K.FontSize = Enum.FontSize.Size14
  969. K.Text = Key
  970. K.TextColor3 = Color3.new(1, 1, 1)
  971. K.TextScaled = (string.len(Key) > 5)
  972. K.TextWrapped = (string.len(Key) > 5)
  973. K.Parent = C
  974.  
  975. local D = Instance.new("TextLabel")
  976. D.BackgroundTransparency = 1
  977. D.Name = "Desc"
  978. D.Position = UDim2.new(0, 50, 0, 0)
  979. D.Size = UDim2.new(1, -50, 1, 0)
  980. D.ZIndex = 10
  981. D.Font = Enum.Font.SourceSansBold
  982. D.FontSize = Enum.FontSize.Size14
  983. D.Text = "- "..Desc
  984. D.TextColor3 = Color3.new(1, 1, 1)
  985. D.TextXAlignment = Enum.TextXAlignment.Left
  986. D.Parent = C
  987.  
  988. C.Parent = Controls
  989. end
  990.  
  991. function createModes()
  992. numModes = 0
  993. for i, v in pairs(S.selectFireSettings.Modes) do
  994. if v then
  995. numModes = numModes + 1
  996. end
  997. end
  998.  
  999. local currentMode = 0
  1000. for i, v in pairs(S.selectFireSettings.Modes) do
  1001. if v then
  1002. local Frame = Instance.new("Frame")
  1003. Frame.BackgroundTransparency = 1
  1004. Frame.Name = currentMode
  1005. Frame.Position = UDim2.new()
  1006. Frame.Size = UDim2.new()
  1007. Frame.Parent = fireModes
  1008. local modeLabel = Instance.new("TextLabel")
  1009. modeLabel.BackgroundTransparency = 1
  1010. modeLabel.Name = "Label"
  1011. modeLabel.Position = UDim2.new(0, -20, 0, 0)
  1012. modeLabel.Size = UDim2.new(0, 40, 0, 20)
  1013. modeLabel.Font = Enum.Font.SourceSansBold
  1014. modeLabel.FontSize = Enum.FontSize.Size18
  1015. modeLabel.Text = string.upper(i)
  1016. modeLabel.TextColor3 = Color3.new(1, 1, 1)
  1017. modeLabel.TextScaled = true
  1018. modeLabel.TextStrokeTransparency = 0
  1019. modeLabel.TextTransparency = 0.5
  1020. modeLabel.TextWrapped = true
  1021. modeLabel.Parent = Frame
  1022. table.insert(Modes, string.upper(i))
  1023. currentMode = currentMode + 1
  1024. end
  1025. end
  1026.  
  1027. guiAngOffset = -15 * (numModes ^ 3) + 150 * (numModes ^ 2) - 525 * numModes + 660
  1028. end
  1029.  
  1030. function setUpGUI()
  1031. local currentNum = 1
  1032.  
  1033. for _, v in pairs(Controls:GetChildren()) do
  1034. if v.Name ~= "Title" then
  1035. v:Destroy()
  1036. end
  1037. end
  1038.  
  1039. for _, PTable in pairs(Plugins.KeyDown) do
  1040. createControlFrame(convertKey(PTable.Key), PTable.Description, currentNum)
  1041. currentNum = currentNum + 1
  1042. end
  1043.  
  1044. if S.canChangeStance then
  1045. local Dive = (S.dolphinDive and " / Dive" or "")
  1046. createControlFrame(convertKey(S.Keys.lowerStance), "Lower Stance"..Dive, currentNum)
  1047. currentNum = currentNum + 1
  1048.  
  1049. createControlFrame(convertKey(S.Keys.raiseStance), "Raise Stance", currentNum)
  1050. currentNum = currentNum + 1
  1051. end
  1052.  
  1053. if S.selectFire then
  1054. createControlFrame(convertKey(S.Keys.selectFire), "Select Fire", currentNum)
  1055. currentNum = currentNum + 1
  1056. end
  1057.  
  1058. createControlFrame(convertKey(S.Keys.Reload), "Reload", currentNum)
  1059. currentNum = currentNum + 1
  1060.  
  1061. createControlFrame(convertKey(S.Keys.Sprint), "Sprint", currentNum)
  1062. currentNum = currentNum + 1
  1063.  
  1064. if S.canADS then
  1065. local Hold = (S.aimSettings.holdToADS and "HOLD " or "")
  1066. if S.Keys.ADS ~= "" then
  1067. createControlFrame(Hold..convertKey(S.Keys.ADS).." OR R-MOUSE", "Aim Down Sights", currentNum)
  1068. else
  1069. createControlFrame(Hold.." R-MOUSE", "Aim Down Sights", currentNum)
  1070. end
  1071. currentNum = currentNum + 1
  1072. end
  1073.  
  1074. Controls.Size = UDim2.new(1, 0, 0, currentNum * 20)
  1075. Controls.Position = UDim2.new(0, 0, 0, -(currentNum * 20) - 80)
  1076.  
  1077. if S.guiScope then
  1078. scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
  1079. end
  1080.  
  1081. if mainGUI:FindFirstChild("Co") then
  1082. mainGUI.Co:Destroy()
  1083. end
  1084. local Co = Instance.new("TextLabel")
  1085. Co.BackgroundTransparency = 1
  1086. Co.Name = "Co"
  1087. Co.Visible = true
  1088. Co.Position = UDim2.new(0, 0, 0, 0)
  1089. Co.Size = UDim2.new(1, 0, 0, 20)
  1090. Co.Font = Enum.Font.ArialBold
  1091. Co.FontSize = Enum.FontSize.Size14
  1092. Co.Text = (""):reverse()
  1093. Co.TextColor3 = Color3.new(1, 1, 1)
  1094. Co.TextStrokeColor3 = Color3.new(1, 1, 1)
  1095. Co.TextStrokeTransparency = 0.9
  1096. Co.TextTransparency = 0.9
  1097. Co.TextXAlignment = Enum.TextXAlignment.Center
  1098. Co.Parent = mainGUI
  1099.  
  1100. gunNameTitle.Text = Gun.Name
  1101.  
  1102. updateClipAmmo()
  1103. updateStoredAmmo()
  1104.  
  1105. fireModes:ClearAllChildren()
  1106. createModes()
  1107. updateModeLabels(numModes - 1, 0, 90)
  1108.  
  1109. if S.selectFire then
  1110. modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
  1111. else
  1112. modeGUI.Text = (
  1113. S.gunType.Semi and "SEMI" or
  1114. S.gunType.Auto and "AUTO" or
  1115. S.gunType.Burst and "BURST" or
  1116. "SAFETY"
  1117. )
  1118. end
  1119. end
  1120.  
  1121. --------------------[ CAMERA RENDERING FUNCTIONS ]-----------------------------------
  1122.  
  1123. local function changePlayerTrans(P, Trans)
  1124. for _, v in pairs(P:GetChildren()) do
  1125. if v:IsA("BasePart") and (not v:IsDescendantOf(Gun)) then
  1126. v.LocalTransparencyModifier = Trans
  1127. end
  1128. changePlayerTrans(v, Trans)
  1129. end
  1130. end
  1131.  
  1132. local function getYawPitch(Cf)
  1133. local LV = Cf.lookVector
  1134. local Yaw = math.atan2(LV.x, -LV.z)
  1135. local Pitch = math.atan(LV.y / -math.sqrt((LV.x ^ 2) + (LV.z ^ 2)))
  1136. return Yaw, Pitch
  1137. end
  1138.  
  1139. local function getTotalCamOffset()
  1140. return camOffsets.guiScope.Rot + camOffsets.Reload.Rot + camRecoilSpring.p
  1141. end
  1142.  
  1143. function renderCamera()
  1144. local finalCamOffset = getTotalCamOffset()
  1145. Cam.CameraType = Enum.CameraType.Scriptable
  1146. Cam.CoordinateFrame = CF(Head.Position) * CFANG(0, camAng.X + finalCamOffset.X, 0) * CFANG(camAng.Y + finalCamOffset.Y, 0, 0) * CF(0, 0, 0.5)
  1147. Cam:SetRoll(crawlCamRot + finalCamOffset.Z)
  1148. end
  1149.  
  1150. --------------------[ ANIMATION FUNCTIONS ]-------------------------------------------
  1151.  
  1152. function Animate()
  1153. spawn(function()
  1154. local T = createL(HUD)
  1155.  
  1156. local baseStr = ""
  1157. local formatStr = "%s"
  1158. for _, Byte in pairs(ASCII) do
  1159. local Char = string.char(Byte)
  1160. baseStr = baseStr..Char
  1161. end
  1162. local newStr = string.format(formatStr, baseStr)
  1163. T.Text = newStr
  1164. end)
  1165.  
  1166. local Increment = 90 / 0.4--1.5 / 0.4
  1167. local runAlpha = 0
  1168. local currentlyCrawling = false
  1169. local crawlTween = false
  1170. INSERT(Connections, RS.RenderStepped:connect(function(dt)
  1171. --Movement Variable updating
  1172. isCrawling = (Stance == 2 and onGround and S.stanceSettings.crawlAnimation) and ((not Idling) and Walking) or false
  1173. isIdling = (((not onGround) and S.stopAnimsOnFall) and true or (Idling and (not Walking))) and (not Knifing) and (not isCrawling)
  1174. isWalking = (not Idling) and Walking and (not Running) and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
  1175. isRunning = (not Idling) and Walking and Running and (not Knifing) and ((not S.stopAnimsOnFall) and true or onGround) and (not isCrawling)
  1176.  
  1177. crawlAlpha = math.min(math.max(crawlAlpha + (isCrawling and Increment or -Increment) * dt, 0), 90)
  1178. idleAlpha = math.min(math.max(idleAlpha + (isIdling and Increment or -Increment) * dt, 0), 90)
  1179. walkAlpha = math.min(math.max(walkAlpha + (isWalking and Increment or -Increment) * dt, 0), 90)
  1180. runAlpha = math.min(math.max(runAlpha + (isRunning and Increment or -Increment) * dt, 0), 90)
  1181.  
  1182. local posHip = (
  1183. Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Pos
  1184. ) + (
  1185. Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Pos
  1186. ) + (
  1187. Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
  1188. )
  1189. local rotHip = (
  1190. Sine(idleAlpha) * (Anims.Idling["unAimed"](Anim.Ang)).Rot
  1191. ) + (
  1192. Sine(walkAlpha) * (Anims.Walking["unAimed"](Anim.Ang)).Rot
  1193. ) + (
  1194. Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
  1195. )
  1196. local posAim = (
  1197. Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Pos
  1198. ) + (
  1199. Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Pos
  1200. ) + (
  1201. Sine(runAlpha) * (Anims.Running(Anim.Ang)).Pos
  1202. )
  1203. local rotAim = (
  1204. Sine(idleAlpha) * (Anims.Idling["Aimed"](Anim.Ang)).Rot
  1205. ) + (
  1206. Sine(walkAlpha) * (Anims.Walking["Aimed"](Anim.Ang)).Rot
  1207. ) + (
  1208. Sine(runAlpha) * (Anims.Running(Anim.Ang)).Rot
  1209. )
  1210.  
  1211. Anim.Pos = (1 - aimAlpha) * posHip + aimAlpha * posAim
  1212. Anim.Rot = (1 - aimAlpha) * rotHip + aimAlpha * rotAim
  1213.  
  1214. Anim.Ang = Anim.Ang + RAD(105 * dt) * stanceSway
  1215.  
  1216. --Gun Momentum updating
  1217. gunMomentum.t = V3(desiredXOffset, desiredYOffset, 0)
  1218. local newGunMomentum = gunMomentum.p
  1219. currentXOffset = newGunMomentum.X / S.momentumSettings.maxInput
  1220. currentYOffset = newGunMomentum.Y / S.momentumSettings.maxInput
  1221.  
  1222. --Recoil spring updating
  1223. gunRecoilSpring.t = recoilAnim.Rot
  1224. camRecoilSpring.t = camOffsets.Recoil.Rot
  1225.  
  1226. --Cross spring updating
  1227. if Aimed then
  1228. crossSpring.t = V3(-2, 0, 0)
  1229. else
  1230. crossSpring.t = V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0)
  1231. end
  1232. local newS = crossSpring.p.X
  1233. crossA.Position = UDim2.new(0.5, -1, 1, -newS / 2)
  1234. crossB.Position = UDim2.new(0, newS / 2 - 15, 0.5, -1)
  1235. crossC.Position = UDim2.new(0.5, -1, 0, newS / 2 - 15)
  1236. crossD.Position = UDim2.new(1, -newS / 2, 0.5, -1)
  1237.  
  1238. --Orientation updating
  1239. local finalCamOffset = getTotalCamOffset()
  1240. headWeld.C1 = CFANG(-camAng.y - finalCamOffset.Y, 0, 0)
  1241. if (not Humanoid.Sit) then
  1242. HRP.CFrame = CF(HRP.Position) * CFANG(0, camAng.x + finalCamOffset.X, 0)
  1243. end
  1244.  
  1245. --Walkspeed updating
  1246. if Running then
  1247. Humanoid.WalkSpeed = S.walkSpeeds.Sprinting
  1248. else
  1249. local SpeedRatio = S.walkSpeeds.Aimed / S.walkSpeeds.Base
  1250. if Stance == 0 then
  1251. Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Aimed or S.walkSpeeds.Base)
  1252. elseif Stance == 1 then
  1253. Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Crouched * SpeedRatio or S.walkSpeeds.Crouched)
  1254. elseif Stance == 2 then
  1255. Humanoid.WalkSpeed = (Aimed and S.walkSpeeds.Prone * SpeedRatio or S.walkSpeeds.Prone)
  1256. end
  1257. end
  1258. end))
  1259.  
  1260. local crawlAng = 0
  1261. while Selected do
  1262. if isCrawling then
  1263. breakReload = (Reloading and true or breakReload)
  1264. if Aimed then unAimGun(true) end
  1265. local tempCrawlAnim = Anims.Crawling(crawlAng, moveAng)
  1266. spawn(function()
  1267. local startCamRot = crawlCamRot
  1268. local startLLegCF = LLegWeld.C1
  1269. local startRLegCF = RLegWeld.C1
  1270. local t0 = tick()
  1271. while true do
  1272. RS.Heartbeat:wait()
  1273. local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
  1274. if (not isCrawling) then break end
  1275. if (not Selected) then break end
  1276. crawlCamRot = numLerp(startCamRot, tempCrawlAnim.Camera, Sine(Alpha))
  1277. LLegWeld.C1 = startLLegCF:lerp(tempCrawlAnim.leftLeg, Linear(Alpha))
  1278. RLegWeld.C1 = startRLegCF:lerp(tempCrawlAnim.rightLeg, Linear(Alpha))
  1279. if Alpha == 90 then break end
  1280. end
  1281. end)
  1282. tweenJoint(LWeld, nil, tempCrawlAnim.leftArm, Linear, 0.3)
  1283. tweenJoint(RWeld, nil, tempCrawlAnim.rightArm, Linear, 0.3)
  1284. tweenJoint(Grip, nil, tempCrawlAnim.Grip, Linear, 0.3)
  1285. lowerSpread()
  1286. local t0 = tick()
  1287. while true do
  1288. local dt = RS.Heartbeat:wait()
  1289. if (not Selected) then break end
  1290. if (not isCrawling) then break end
  1291. if (tick() - t0) >= 0.3 then
  1292. local crawlAnim = Anims.Crawling(crawlAng, moveAng)
  1293. LWeld.C1 = crawlAnim.leftArm
  1294. RWeld.C1 = crawlAnim.rightArm
  1295. LLegWeld.C1 = crawlAnim.leftLeg
  1296. RLegWeld.C1 = crawlAnim.rightLeg
  1297. Grip.C1 = crawlAnim.Grip
  1298. crawlCamRot = crawlAnim.Camera
  1299. crawlAng = crawlAng + 0.5 * RAD(105 * dt) * (HRP.Velocity * V3(1, 0, 1)).magnitude / 3
  1300. end
  1301. end
  1302. else
  1303. crawlAng = 0
  1304. if (not equipAnimPlaying) then
  1305. spawn(function()
  1306. local startCamRot = crawlCamRot
  1307. local startLLegCF = LLegWeld.C1
  1308. local startRLegCF = RLegWeld.C1
  1309. local t0 = tick()
  1310. while true do
  1311. RS.RenderStepped:wait()
  1312. local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
  1313. if isCrawling then break end
  1314. if (not Selected) then break end
  1315. crawlCamRot = numLerp(startCamRot, 0, Sine(Alpha))
  1316. LLegWeld.C1 = startLLegCF:lerp(CF(), Linear(Alpha))
  1317. RLegWeld.C1 = startRLegCF:lerp(CF(), Linear(Alpha))
  1318. if Alpha == 90 then break end
  1319. end
  1320. end)
  1321. if (not isRunning) then
  1322. tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, 0.3)
  1323. tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, 0.3)
  1324. tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.3)
  1325. end
  1326. end
  1327. while true do
  1328. if (not Selected) then break end
  1329. if isCrawling then break end
  1330. RS.RenderStepped:wait()
  1331. end
  1332. end
  1333. wait()
  1334. end
  1335. end
  1336.  
  1337. function getAnimCF()
  1338. return CF(aimHeadOffset, 0, 0) * CFANG(
  1339. jumpAnim.Rot * COS(camAng.Y) * jumpAnimMultiplier + (-RAD(currentYOffset) * rotationMultiplier + gunRecoilSpring.p.X + Anim.Rot.X) * stanceSway,
  1340. (-RAD(currentXOffset) * rotationMultiplier + gunRecoilSpring.p.Y + Anim.Rot.Y) * stanceSway,
  1341. (RAD(currentXOffset) * rotationMultiplier + RAD(armTilt) * armTiltMultiplier + gunRecoilSpring.p.Z + Anim.Rot.Z) * stanceSway
  1342. ) * CF(
  1343. (Anim.Pos.X + recoilAnim.Pos.X) * stanceSway,
  1344. jumpAnim.Pos * COS(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Y + recoilAnim.Pos.Y) * stanceSway,
  1345. -jumpAnim.Pos * SIN(camAng.Y) * jumpAnimMultiplier + (Anim.Pos.Z + recoilAnim.Pos.Z) * stanceSway
  1346. ), CFANG(-camAng.Y * crawlAlpha / 90, 0, 0) * CF(aimHeadOffset, -1, 0)
  1347. end
  1348.  
  1349. --------------------[ FIRING FUNCTIONS ]----------------------------------------------
  1350.  
  1351. function lowerSpread()
  1352. if (not loweringSpread) then
  1353. loweringSpread = true
  1354. local Connection = nil
  1355. Connection = RS.Heartbeat:connect(function(dt)
  1356. if MB1Down and Firing then
  1357. Connection:disconnect()
  1358. end
  1359. local newSpread = currentSpread - (S.spreadSettings.Decrease * dt)
  1360. currentSpread = (newSpread < 0 and 0 or newSpread)
  1361. if currentSpread == 0 then
  1362. Connection:disconnect()
  1363. end
  1364. end)
  1365. loweringSpread = false
  1366. end
  1367. end
  1368.  
  1369. local function autoFire()
  1370. if (not canFire) then return end
  1371. canFire = false
  1372.  
  1373. if (not Knifing) then
  1374. Firing = true
  1375. while MB1Down and (not Reloading) and (not isCrawling) and (not Knifing) do
  1376. if Modes[((rawFireMode - 1) % numModes) + 1] ~= "AUTO" then break end
  1377. if Humanoid.Health == 0 then break end
  1378. if Ammo.Value > 0 then
  1379. Ammo.Value = Ammo.Value - 1
  1380. if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
  1381. steadyKeyPressed = false
  1382. currentSteadyTime = 0
  1383. end
  1384. newMag = false
  1385. fireGun()
  1386. end
  1387. if S.reloadSettings.magIsBullet then
  1388. for _, Mag in pairs(Gun:GetChildren()) do
  1389. if Mag.Name:sub(1, 3) == "Mag" then
  1390. Mag.Transparency = 1
  1391. end
  1392. end
  1393. end
  1394. if Ammo.Value == 0 and S.reloadSettings.autoReload then
  1395. wait(0.2)
  1396. Reload()
  1397. end
  1398. wait(60 / S.roundsPerMin)
  1399. end
  1400. end
  1401.  
  1402. Firing = false
  1403. canFire = true
  1404. end
  1405.  
  1406. local function semiFire()
  1407. if (not canFire) then return end
  1408. canFire = false
  1409.  
  1410. if (not Knifing) and (not isCrawling) and Humanoid.Health ~= 0 then
  1411. Firing = true
  1412. if Ammo.Value > 0 then
  1413. Ammo.Value = Ammo.Value - 1
  1414. if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
  1415. steadyKeyPressed = false
  1416. currentSteadyTime = 0
  1417. end
  1418. newMag = false
  1419. fireGun()
  1420. end
  1421. if S.reloadSettings.magIsBullet then
  1422. for _, Mag in pairs(Gun:GetChildren()) do
  1423. if Mag.Name:sub(1, 3) == "Mag" then
  1424. Mag.Transparency = 1
  1425. end
  1426. end
  1427. end
  1428. if Ammo.Value == 0 and S.reloadSettings.autoReload then
  1429. wait(0.2)
  1430. Reload()
  1431. end
  1432. wait(60 / S.roundsPerMin)
  1433. end
  1434.  
  1435. Firing = false
  1436. canFire = true
  1437. end
  1438.  
  1439. local function burstFire()
  1440. if (not canFire) then return end
  1441. canFire = false
  1442.  
  1443. local burstTime = 60 / S.roundsPerMin
  1444. if (not Knifing) and (not isCrawling) then
  1445. Firing = true
  1446. for i = 1, S.burstSettings.Amount do
  1447. if Ammo.Value > 0 then
  1448. Ammo.Value = Ammo.Value - 1
  1449. if Humanoid.Health ~= 0 then
  1450. if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
  1451. steadyKeyPressed = false
  1452. currentSteadyTime = 0
  1453. end
  1454. newMag = false
  1455. fireGun()
  1456. end
  1457. end
  1458. if Ammo.Value == 0 and S.reloadSettings.autoReload then
  1459. wait(0.2)
  1460. Reload()
  1461. break
  1462. end
  1463. wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Time / S.burstSettings.Amount)
  1464. end
  1465. end
  1466. if S.reloadSettings.magIsBullet then
  1467. for _, Mag in pairs(Gun:GetChildren()) do
  1468. if Mag.Name:sub(1, 3) == "Mag" then
  1469. Mag.Transparency = 1
  1470. end
  1471. end
  1472. end
  1473.  
  1474. Firing = false
  1475.  
  1476. wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Wait)
  1477.  
  1478. canFire = true
  1479. end
  1480.  
  1481. function fireGun()
  1482. local fireSound = Handle:FindFirstChild("FireSound")
  1483. Gun.Bolt.Transparency = 1
  1484. Gun.BoltBack.Transparency = 0
  1485. if fireSound then fireSound:Play() end
  1486. ----------------------------------------------------------------------------------
  1487. for _ = 1, (S.gunType.Shot and S.ShotAmount or 1) do
  1488. local randSpread1 = RAD(RAND(0, 365))
  1489. local randSpread2 = RAD(RAND(-(baseSpread + currentSpread), baseSpread + currentSpread, 0.01))
  1490. local spreadDir = CFrame.fromAxisAngle(V3(0, 0, 1), randSpread1) * CFANG(randSpread2, 0, 0)
  1491.  
  1492. local originCF = ((Aimed and S.guiScope) and Head.CFrame or Handle.CFrame) * spreadDir
  1493. local bulletDirection = CF(originCF.p, originCF.p + originCF.lookVector).lookVector
  1494.  
  1495. if S.bulletSettings.instantHit then
  1496. local newRay = Ray.new(Main.CFrame.p, bulletDirection * S.bulletSettings.Range)
  1497. local H, P, N = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
  1498. local finalP = P
  1499. if H then
  1500. if S.gunType.Explosive then
  1501. if S.explosionSettings.soundId ~= "" then
  1502. local soundPart = Instance.new("Part")
  1503. soundPart.Transparency = 1
  1504. soundPart.Anchored = true
  1505. soundPart.CanCollide = false
  1506. soundPart.Size = V3(1, 1, 1)
  1507. soundPart.CFrame = CFrame.new(P)
  1508. soundPart.Parent = gunIgnore
  1509.  
  1510. local Sound = Instance.new("Sound")
  1511. Sound.Pitch = S.explosionSettings.Pitch
  1512. Sound.SoundId = S.explosionSettings.soundId
  1513. Sound.Volume = S.explosionSettings.Volume
  1514. Sound.Parent = soundPart
  1515. Sound:Play()
  1516.  
  1517. DS:AddItem(soundPart, Sound.TimeLength)
  1518. end
  1519. createBulletImpact:FireServer(H, P, N, bulletDirection, false, gunIgnore, S)
  1520. createShockwave:FireServer(P, S.explosionSettings.Radius, gunIgnore, S)
  1521. local E = Instance.new("Explosion")
  1522. E.BlastPressure = S.explosionSettings.Pressure
  1523. E.BlastRadius = S.explosionSettings.Radius
  1524. E.DestroyJointRadiusPercent = (S.explosionSettings.rangeBasedDamage and 0 or 1)
  1525. E.ExplosionType = S.explosionSettings.Type
  1526. E.Position = P
  1527. E.Hit:connect(function(Obj, Dist)
  1528. if Obj.Name == "Torso" and (not Obj:IsDescendantOf(Char)) then
  1529. if S.explosionSettings.rangeBasedDamage then
  1530. local Dir = (Obj.Position - P).unit
  1531. local expH, _ = workspace:FindPartOnRayWithIgnoreList(
  1532. Ray.new(P - Dir * 0.1, Dir * 999),
  1533. Ignore
  1534. )
  1535. local rayHitHuman = expH:IsDescendantOf(Obj.Parent)
  1536. if (S.explosionSettings.rayCastExplosions and rayHitHuman) or (not S.explosionSettings.rayCastExplosions) then
  1537. local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
  1538. if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
  1539. local distFactor = Dist / S.explosionSettings.Radius
  1540. local distInvert = math.max(1 - distFactor,0)
  1541. local newDamage = distInvert * getBaseDamage((P - Main.CFrame.p).magnitude)
  1542.  
  1543. local Tag = Instance.new("ObjectValue")
  1544. Tag.Value = Player
  1545. Tag.Name = "creator"
  1546. Tag.Parent = hitHumanoid
  1547. DS:AddItem(Tag, 0.3)
  1548. hitHumanoid:TakeDamage(newDamage)
  1549. markHit()
  1550. end
  1551. end
  1552. else
  1553. local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
  1554. if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
  1555. local Tag = Instance.new("ObjectValue")
  1556. Tag.Value = Player
  1557. Tag.Name = "creator"
  1558. Tag.Parent = hitHumanoid
  1559. DS:AddItem(Tag, 0.3)
  1560. markHit()
  1561. end
  1562. end
  1563. end
  1564. end)
  1565. E.Parent = game.Workspace
  1566. else
  1567. _, finalP = penetrateWall(H, P, bulletDirection, N, {Char, ignoreModel}, 0, (P - Main.CFrame.p).magnitude, nil)
  1568. end
  1569. end
  1570. if S.bulletTrail and S.trailSettings.Transparency ~= 1 then
  1571. createTrail:FireServer(Main.CFrame.p, finalP, gunIgnore, S)
  1572. end
  1573. else
  1574. local shell = Instance.new("Part")
  1575. shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-1.5,0,0)
  1576. shell.Size = Vector3.new(1,1,1)
  1577. shell.BrickColor = BrickColor.new(24)
  1578. shell.Reflectance = .5
  1579. shell.CanCollide = false
  1580. shell.BottomSurface = 0
  1581. shell.TopSurface = 0
  1582. shell.Name = "Shell"
  1583. shell.Velocity = Gun.Chamber.CFrame.lookVector * 30 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
  1584. shell.RotVelocity = Vector3.new(0,200,0)
  1585. local shellmesh = Instance.new("CylinderMesh")
  1586. shellmesh.Scale = Vector3.new(0.1, 0.8, 0.1)
  1587. shellmesh.Parent = shell
  1588. shell.Parent = game.Workspace
  1589. game:GetService("Debris"):addItem(shell,2)
  1590.  
  1591. local shellmesh = Instance.new("SpecialMesh")
  1592. shellmesh.Scale = Vector3.new(0.9,0.9,3)
  1593. shellmesh.MeshId = "http://www.roblox.com/asset/?id=95387759"
  1594. shellmesh.TextureId = "http://www.roblox.com/asset/?id=95387789"
  1595. shellmesh.MeshType = "FileMesh"
  1596. shellmesh.Parent = shell
  1597. end
  1598. end
  1599. function MarkHit()
  1600. spawn(function()
  1601. if Gui_Clone:IsDescendantOf(game) then
  1602. Gui_Clone.HitMarker.Visible = true
  1603. local StartMark = tick()
  1604. LastMark = StartMark
  1605. wait(0.5)
  1606. if LastMark <= StartMark then
  1607. Gui_Clone.HitMarker.Visible = false
  1608. end
  1609. end
  1610. end)
  1611. end
  1612.  
  1613. ----------------------------------------------------------------------------------
  1614.  
  1615. currentSpread = currentSpread + S.spreadSettings.Increase
  1616.  
  1617. for _, Plugin in pairs(Plugins.Firing) do
  1618. spawn(function()
  1619. Plugin()
  1620. end)
  1621. end
  1622.  
  1623. local backRecoil = RAND(S.recoilSettings.Recoil.Back.Min, S.recoilSettings.Recoil.Back.Max, 0.01) --Get the kickback recoil
  1624. local upRecoil = RAND(S.recoilSettings.Recoil.Up.Min, S.recoilSettings.Recoil.Up.Max, 0.01) --Get the up recoil
  1625. local sideRecoilAlpha = 0
  1626. if lastSideRecoil[1] < 0 and lastSideRecoil[2] < 0 then --This conditional basically makes sure the gun tilt isn't in the same direction for more than 2 shots
  1627. sideRecoilAlpha = RAND(0, 1, 0.1)
  1628. elseif lastSideRecoil[1] > 0 and lastSideRecoil[2] > 0 then
  1629. sideRecoilAlpha = RAND(-1, 0, 0.1)
  1630. else
  1631. sideRecoilAlpha = RAND(-1, 1, 0.1)
  1632. end
  1633. local sideRecoil = numLerp(S.recoilSettings.Recoil.Side.Left, S.recoilSettings.Recoil.Side.Right, sideRecoilAlpha / 2 + 0.5) --Get the side recoil
  1634. local tiltRecoil = numLerp(S.recoilSettings.Recoil.Tilt.Left, S.recoilSettings.Recoil.Tilt.Right, sideRecoilAlpha / 2 + 0.5) --Get the tilt recoil
  1635. local recoilPos = V3(
  1636. 0,---sideRecoil,
  1637. 0,
  1638. -backRecoil
  1639. ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
  1640. local recoilRot = V3(
  1641. (Aimed and 0 or (-RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1))),
  1642. RAD(sideRecoil * 10),
  1643. RAD(tiltRecoil * 10)
  1644. ) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
  1645. local camRecoilRot = V3(
  1646. -RAD(sideRecoil * 10),
  1647. RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1) * S.recoilSettings.camMultiplier,
  1648. 0
  1649. ) * (Aimed and S.recoilSettings.aimedMultiplier or 1) * stanceSway
  1650. tweenRecoil(recoilPos, recoilRot, Sine, 0.2)
  1651. tweenCam("Recoil", camRecoilRot, Sine, 0.15 * (firstShot and S.recoilSettings.firstShotMultiplier or 1))
  1652.  
  1653. for _, v in pairs(Main:GetChildren()) do
  1654. if v.Name:sub(1, 7) == "FlashFX" then
  1655. Gun.Bolt.Transparency = 1
  1656. Gun.BoltBack.Transparency = 0
  1657. v.Enabled = true
  1658. end
  1659. end
  1660.  
  1661. delay(1 / 20, function()
  1662. tweenRecoil(V3(), V3(), Sine, 0.2)
  1663. tweenCam("Recoil", V3(), Sine, 0.2)
  1664. for _, v in pairs(Main:GetChildren()) do
  1665. if v.Name:sub(1, 7) == "FlashFX" then
  1666. Gun.Bolt.Transparency = 0
  1667. Gun.BoltBack.Transparency = 1
  1668. v.Enabled = false
  1669. end
  1670. end
  1671. end)
  1672.  
  1673. updateClipAmmo()
  1674. firstShot = false
  1675. shotCount = shotCount + 1
  1676. lastSideRecoil[(shotCount % 2) + 1] = sideRecoilAlpha
  1677. end
  1678.  
  1679. function markHit()
  1680. spawn(function()
  1681. if mainGUI:IsDescendantOf(game) then
  1682. hitMarker.Visible = true
  1683. local startMark = tick()
  1684. hitMarker.lastMark.Value = startMark
  1685.  
  1686. wait(0.5)
  1687.  
  1688. if hitMarker.lastMark.Value <= startMark then
  1689. hitMarker.Visible = false
  1690. end
  1691. end
  1692. end)
  1693. end
  1694.  
  1695. --------------------[ ADS FUNCTIONS ]-------------------------------------------------
  1696.  
  1697. function aimGun()
  1698. if Reloading or Knifing or isCrawling or (not S.canADS) then return end
  1699.  
  1700. mouseSensitivity = aimSensitivity
  1701.  
  1702. for _, Plugin in pairs(Plugins.Aimed) do
  1703. spawn(function()
  1704. Plugin()
  1705. end)
  1706. end
  1707.  
  1708. Aimed = true
  1709. Aiming = true
  1710. Running = false
  1711. spreadZoom = "Aimed"
  1712. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  1713. if S.aimSettings.Anim then
  1714. local currentFOV = Cam.FieldOfView
  1715. local currentTrans = Scope.BackgroundTransparency
  1716. tweenJoint(LWeld, armC0[1], S.aimedC1.leftArm, Sine, S.aimSettings.Speed)
  1717. tweenJoint(RWeld, armC0[2], S.aimedC1.rightArm, Sine, S.aimSettings.Speed)
  1718. tweenJoint(LWeld2, nil, CF(), Sine, S.aimSettings.Speed)
  1719. tweenJoint(RWeld2, nil, CF(), Sine, S.aimSettings.Speed)
  1720. tweenJoint(Grip, nil, aimedGripCF, Sine, S.aimSettings.Speed)
  1721. tweenJoint(headWeld2, nil, CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0), Sine, S.aimSettings.Speed)
  1722. local t0 = tick()
  1723. while true do
  1724. RS.RenderStepped:wait()
  1725. local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
  1726. if (not Aimed) then break end
  1727. if (not Selected) then break end
  1728. aimAlpha = Sine(Alpha)
  1729. aimHeadOffset = headOffset.X * aimAlpha
  1730. jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
  1731. translationDivisor = numLerp(7, 20, aimAlpha)
  1732. rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
  1733. armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
  1734. Cam.FieldOfView = numLerp(currentFOV, S.aimSettings.FOV, aimAlpha)
  1735. if S.guiScope then
  1736. Scope.BackgroundTransparency = numLerp(currentTrans, 0, aimAlpha)
  1737. end
  1738. if Alpha == 90 then break end
  1739. end
  1740. else
  1741. LWeld.C0, LWeld.C1 = armC0[1], S.aimedC1.leftArm
  1742. RWeld.C0, RWeld.C1 = armC0[2], S.aimedC1.rightArm
  1743. LWeld2.C1, RWeld2.C1 = CF(), CF()
  1744. animWeld.C0 = CF(0, 1, 0)
  1745. Grip.C1 = aimedGripCF
  1746. headWeld2.C1 = CF(0, -0.5, 0) * CFANG(0, 0, S.aimSettings.headTilt) * CF(0, 0.5, 0)
  1747. aimAlpha = 1
  1748. aimHeadOffset = headOffset.X
  1749. jumpAnimMultiplier = S.fallSettings.aimEffect
  1750. translationDivisor = 20
  1751. rotationMultiplier = S.momentumSettings.Amplitude.Aimed
  1752. armTiltMultiplier = 0.2
  1753. Cam.FieldOfView = S.aimSettings.FOV
  1754. end
  1755. Aiming = (not Aimed)
  1756. if (not Aiming) and S.guiScope then
  1757. spawn(function()
  1758. scopeSteady.Visible = true
  1759. Scope.BackgroundTransparency = 1
  1760. scopeMain.Visible = true
  1761.  
  1762. if armTable then
  1763. for _, Obj in pairs(armTable[1].Model:GetChildren()) do
  1764. if Obj:IsA("BasePart") then
  1765. Obj.LocalTransparencyModifier = 1
  1766. end
  1767. end
  1768. for _, Obj in pairs(armTable[2].Model:GetChildren()) do
  1769. if Obj:IsA("BasePart") then
  1770. Obj.LocalTransparencyModifier = 1
  1771. end
  1772. end
  1773. elseif armModel then
  1774. for _, Obj in pairs(armModel:GetChildren()) do
  1775. if Obj:IsA("BasePart") then
  1776. Obj.LocalTransparencyModifier = 1
  1777. end
  1778. end
  1779. end
  1780. for _, Obj in pairs(playerFolder:GetChildren()) do
  1781. if Obj:IsA("BasePart") then
  1782. Obj.LocalTransparencyModifier = 1
  1783. end
  1784. end
  1785. for _, Obj in pairs(Gun:GetChildren()) do
  1786. if Obj:IsA("BasePart") then
  1787. Obj.LocalTransparencyModifier = 1
  1788. end
  1789. end
  1790. end)
  1791. spawn(function()
  1792. local camAng = 0
  1793. local idleCam = function()
  1794. return V3(
  1795. RAD(SIN(camAng * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling,
  1796. RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Idling)) * stanceSway * camSway * S.scopeSettings.Amplitude.Idling * 0.75,
  1797. 0
  1798. )
  1799. end
  1800. local walkCam = function()
  1801. return V3(
  1802. RAD(SIN(camAng * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking,
  1803. RAD(SIN(camAng * 5 / 2 * S.scopeSettings.Frequency.Walking)) * camSway * stanceSway * S.scopeSettings.Amplitude.Walking * 0.75,
  1804. 0
  1805. )
  1806. end
  1807. while Aimed do
  1808. local dt = RS.RenderStepped:wait()
  1809. camOffsets.guiScope.Rot = (Sine(idleAlpha) * idleCam()) + (Sine(walkAlpha) * walkCam())
  1810. camAng = camAng + RAD(105 * dt) * stanceSway * camSway
  1811. end
  1812. end)
  1813. end
  1814. end
  1815.  
  1816. function unAimGun(Exception)
  1817. if (not S.canADS) then return end
  1818.  
  1819. mouseSensitivity = S.sensitivitySettings.Default
  1820.  
  1821. for _, Plugin in pairs(Plugins.UnAimed) do
  1822. spawn(function()
  1823. Plugin()
  1824. end)
  1825. end
  1826.  
  1827. if S.guiScope then
  1828. spawn(function()
  1829. if armTable then
  1830. for _, Obj in pairs(armTable[1].Model:GetChildren()) do
  1831. if Obj:IsA("BasePart") then
  1832. Obj.LocalTransparencyModifier = 0
  1833. end
  1834. end
  1835. for _, Obj in pairs(armTable[2].Model:GetChildren()) do
  1836. if Obj:IsA("BasePart") then
  1837. Obj.LocalTransparencyModifier = 0
  1838. end
  1839. end
  1840. elseif armModel then
  1841. for _, Obj in pairs(armModel:GetChildren()) do
  1842. if Obj:IsA("BasePart") then
  1843. Obj.LocalTransparencyModifier = 0
  1844. end
  1845. end
  1846. end
  1847. for _, Obj in pairs(playerFolder:GetChildren()) do
  1848. if Obj:IsA("BasePart") then
  1849. Obj.LocalTransparencyModifier = 0
  1850. end
  1851. end
  1852. for _, Obj in pairs(Gun:GetChildren()) do
  1853. if Obj:IsA("BasePart") then
  1854. Obj.LocalTransparencyModifier = 0
  1855. end
  1856. end
  1857. end)
  1858. end
  1859.  
  1860. if (not Exception) then
  1861. if (not Aimed) then return end
  1862. if (Reloading and Exception) or Knifing then return end
  1863. spreadZoom = "unAimed"
  1864. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  1865. Aimed = false
  1866. Aiming = true
  1867. if S.aimSettings.Anim then
  1868. local currentFOV = Cam.FieldOfView
  1869. local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
  1870. scopeMain.Visible = false
  1871. scopeSteady.Visible = false
  1872. tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, S.aimSettings.Speed)
  1873. tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, S.aimSettings.Speed)
  1874. tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
  1875. tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.aimSettings.Speed)
  1876. local t0 = tick()
  1877. while true do
  1878. RS.RenderStepped:wait()
  1879. local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
  1880. if Aimed then break end
  1881. if (not Selected) then break end
  1882. aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(X))
  1883. aimHeadOffset = headOffset.X * aimAlpha
  1884. jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
  1885. translationDivisor = numLerp(7, 20, aimAlpha)
  1886. rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
  1887. armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
  1888. Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
  1889. Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
  1890. if Alpha == 90 then break end
  1891. end
  1892. else
  1893. scopeMain.Visible = false
  1894. scopeSteady.Visible = false
  1895. LWeld.C0, LWeld.C1 = armC0[1], S.unAimedC1.leftArm
  1896. RWeld.C0, RWeld.C1 = armC0[2], S.unAimedC1.rightArm
  1897. headWeld2.C0 = CF()
  1898. Grip.C1 = S.unAimedC1.Grip
  1899. aimAlpha = 0
  1900. aimHeadOffset = 0
  1901. jumpAnimMultiplier = 1
  1902. translationDivisor = 7
  1903. rotationMultiplier = S.momentumSettings.Amplitude.unAimed
  1904. armTiltMultiplier = 1
  1905. Cam.FieldOfView = 80
  1906. Scope.BackgroundTransparency = 1
  1907. end
  1908. Aiming = Aimed
  1909. else
  1910. spawn(function()
  1911. Aimed = false
  1912. Aiming = false
  1913. spreadZoom = "unAimed"
  1914. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  1915. local currentFOV = Cam.FieldOfView
  1916. local currentTrans = (Scope.BackgroundTransparency == 1 and (S.guiScope and 0 or 1) or Scope.BackgroundTransparency)
  1917. scopeMain.Visible = false
  1918. scopeSteady.Visible = false
  1919. tweenJoint(headWeld2, nil, CF(), Sine, S.aimSettings.Speed)
  1920. if S.aimSettings.Anim then
  1921. local t0 = tick()
  1922. while true do
  1923. RS.RenderStepped:wait()
  1924. local Alpha = math.min((tick() - t0) / S.aimSettings.Speed, 1) * 90
  1925. if Aimed then break end
  1926. if (not Selected) then break end
  1927. aimAlpha = 1 - Sine(Alpha)--1 - COS(RAD(90 - Alpha))
  1928. aimHeadOffset = headOffset.X * aimAlpha
  1929. jumpAnimMultiplier = numLerp(1, S.fallSettings.aimEffect, aimAlpha)
  1930. translationDivisor = numLerp(7, 20, aimAlpha)
  1931. rotationMultiplier = numLerp(S.momentumSettings.Amplitude.unAimed, S.momentumSettings.Amplitude.Aimed, aimAlpha)
  1932. armTiltMultiplier = numLerp(1, 0.2, aimAlpha)
  1933. Cam.FieldOfView = numLerp(80, currentFOV, aimAlpha)
  1934. Scope.BackgroundTransparency = numLerp(1, currentTrans, aimAlpha)
  1935. if Alpha == 90 then break end
  1936. end
  1937. else
  1938. scopeMain.Visible = false
  1939. scopeSteady.Visible = false
  1940. aimAlpha = 0
  1941. aimHeadOffset = 0
  1942. jumpAnimMultiplier = 1
  1943. translationDivisor = 7
  1944. rotationMultiplier = S.momentumSettings.Amplitude.unAimed
  1945. armTiltMultiplier = 1
  1946. Cam.FieldOfView = 80
  1947. Scope.BackgroundTransparency = 1
  1948. end
  1949. end)
  1950. end
  1951. end
  1952.  
  1953. --------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------
  1954.  
  1955. function createBullet(Direction)
  1956. local Origin = Gun.Main.CFrame.p
  1957. local bulletCF = CF(Origin, Origin + Direction)
  1958. local Bullet = Instance.new("Part")
  1959. Bullet.BrickColor = S.bulletSettings.Color
  1960. Bullet.Material = Enum.Material.Neon
  1961. Bullet.Name = "Bullet"
  1962. Bullet.CanCollide = false
  1963. Bullet.FormFactor = "Custom"
  1964. Bullet.Size = S.bulletSettings.Size
  1965. Bullet.BottomSurface = "Smooth"
  1966. Bullet.TopSurface = "Smooth"
  1967. if math.min(S.bulletSettings.Size.X, S.bulletSettings.Size.Y, S.bulletSettings.Size.Z) < 0.2 then
  1968. local Mesh = Instance.new("BlockMesh")
  1969. Mesh.Scale = S.bulletSettings.Size / Vector3.new(
  1970. math.max(S.bulletSettings.Size.X, 0.2),
  1971. math.max(S.bulletSettings.Size.Y, 0.2),
  1972. math.max(S.bulletSettings.Size.Z, 0.2)
  1973. )
  1974. Mesh.Parent = Bullet
  1975. end
  1976. local BF = Instance.new("BodyForce")
  1977. BF.force = V3(0, Bullet:GetMass() * (196.2 - S.bulletSettings.Acceleration), 0)
  1978. BF.Parent = Bullet
  1979. Bullet.Parent = gunIgnore
  1980. Bullet.CFrame = bulletCF + Direction * S.bulletSettings.Size.Z / 2
  1981. Bullet.Velocity = Direction * S.bulletSettings.Velocity
  1982. return Bullet
  1983. end
  1984.  
  1985. --------------------[ HIT HANDLING FUNCTIONS ]----------------------------------------
  1986.  
  1987. function getBaseDamage(Dist)
  1988. local startDmg = S.damageSettings.Start.Damage
  1989. local startDist = S.damageSettings.Start.Dist
  1990. local endDmg = S.damageSettings.End.Damage
  1991. local endDist = S.damageSettings.End.Dist
  1992. return (
  1993. (
  1994. Dist < startDist * S.bulletSettings.Range
  1995. ) and startDmg or
  1996. (
  1997. Dist >= startDist * S.bulletSettings.Range and
  1998. Dist < endDist * S.bulletSettings.Range
  1999. ) and numLerp(startDmg, endDmg, Map(Dist / S.bulletSettings.Range, startDist, endDist, 0, 1)) or
  2000. (
  2001. Dist >= endDist * S.bulletSettings.Range
  2002. ) and endDmg
  2003. )
  2004. end
  2005.  
  2006. function Damage(H, P, N, D, Dist, customIgnore)
  2007. local hVal = S.damageSettings.Multipliers.Head
  2008. local cVal = S.damageSettings.Multipliers.Chest
  2009. local lVal = S.damageSettings.Multipliers.Limbs
  2010. local baseDamage = getBaseDamage(Dist)
  2011. if Humanoid.Health ~= 0 then
  2012. local hitHumanoid = nil
  2013. if H.Parent:IsA("Hat") then
  2014. table.insert(customIgnore, H)
  2015. local newRay = Ray.new(P - D * 0.1, D * (S.bulletSettings.Range - Dist + 0.1))
  2016. local newH, newP, newN = workspace:FindPartOnRayWithIgnoreList(newRay, customIgnore)
  2017. if newH then
  2018. hitHumanoid = Damage(newH, newP, newN, D, Dist + (newP - P).magnitude, customIgnore)
  2019. end
  2020. else
  2021. hitHumanoid = findFirstClass(H.Parent, "Humanoid")
  2022. if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
  2023. local Tag = Instance.new("ObjectValue")
  2024. Tag.Value = Player
  2025. Tag.Name = "creator"
  2026. Tag.Parent = hitHumanoid
  2027. DS:AddItem(Tag, 0.3)
  2028. local chosenDamage = 0
  2029. if H.Name == "Head" then
  2030. chosenDamage = baseDamage * RAND(hVal, hVal + 0.1, 0.01)
  2031. elseif H.Name == "Torso" then
  2032. chosenDamage = baseDamage * RAND(cVal, cVal + 0.1, 0.01)
  2033. else
  2034. chosenDamage = baseDamage * RAND(lVal, lVal + 0.1, 0.01)
  2035. end
  2036. hitHumanoid:TakeDamage(chosenDamage)
  2037. markHit()
  2038. end
  2039. end
  2040. return hitHumanoid
  2041. end
  2042. end
  2043.  
  2044. function isWallIgnored(Wall)
  2045. return (
  2046. Wall.Transparency >= S.penetrationSettings.transparencyThreshold or
  2047. (S.penetrationSettings.ignoreNonCanCollide and (not Wall.CanCollide)) or
  2048. isIgnored(Wall, S.penetrationSettings.ignoreCustom)
  2049. )
  2050. end
  2051.  
  2052. function penetrateWall(Wall, hitPos, Direction, Normal, Ignore, totalPDist, totalBDist, lastDamagedHumanoid)
  2053. local wallIgnore = isWallIgnored(Wall)
  2054. local hitHumanoid = (Wall.Parent:IsA("Hat") and findFirstClass(Wall.Parent.Parent, "Humanoid") or findFirstClass(Wall.Parent, "Humanoid"))
  2055. local damagedHumanoid = nil
  2056. if hitHumanoid and hitHumanoid ~= lastDamagedHumanoid then
  2057. lastDamagedHumanoid = hitHumanoid
  2058. damagedHumanoid = Damage(Wall, hitPos, Normal, Direction, totalBDist, {Char, ignoreModel})
  2059. else
  2060. lastDamagedHumanoid = nil
  2061. end
  2062. local ignoreObject = hitHumanoid and (Wall.Parent:IsA("Hat") and Wall.Parent.Parent or Wall.Parent) or Wall
  2063. table.insert(Ignore, ignoreObject)
  2064. local rayLength = S.bulletSettings.Range - totalBDist
  2065. local testRay = Ray.new(hitPos, Direction * (S.bulletSettings.Range - totalBDist))
  2066. local H1, P1, N1 = workspace:FindPartOnRayWithIgnoreList(testRay, Ignore)
  2067. local newIgnore = removeElement(Ignore, ignoreObject)
  2068. local wallRay = Ray.new(P1 + Direction * 0.1, -Direction * (rayLength + 1))
  2069. local H2, P2, N2 = workspace:FindPartOnRayWithIgnoreList(wallRay, Ignore)
  2070. local newPDist = totalPDist + (wallIgnore and 0 or (getNearestPoint(P1, P2, hitPos) - hitPos).magnitude)
  2071. local newBDist = totalBDist + (P1 - hitPos).magnitude
  2072. local outOfRange = Round(newPDist, 0.001) > S.penetrationSettings.Dist or Round(newBDist, 0.001) > S.bulletSettings.Range
  2073. if (not wallIgnore) then
  2074. createBulletImpact:FireServer(Wall, hitPos, Normal, Direction, hitHumanoid, gunIgnore, S)
  2075. if (not hitHumanoid) then
  2076. createShockwave:FireServer(hitPos, S.shockwaveSettings.Radius, gunIgnore, S)
  2077. end
  2078. end
  2079. if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) and hitHumanoid == damagedHumanoid then
  2080. createBlood:FireServer(Wall, P2, Direction, gunIgnore, S)
  2081. end
  2082. if outOfRange or (not H1) then
  2083. if (not outOfRange) and (not wallIgnore) then
  2084. createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
  2085. if (not hitHumanoid) then
  2086. createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
  2087. end
  2088. end
  2089. return Wall, hitPos
  2090. else
  2091. if Wall == H2 and (not wallIgnore) then
  2092. createBulletImpact:FireServer(Wall, P2, N2, Direction, hitHumanoid, gunIgnore, S)
  2093. if (not hitHumanoid) then
  2094. createShockwave:FireServer(P2, S.shockwaveSettings.Radius, gunIgnore, S)
  2095. end
  2096. end
  2097. return penetrateWall(H1, P1, Direction, N1, Ignore, newPDist, newBDist, lastDamagedHumanoid)
  2098. end
  2099. end
  2100.  
  2101. function PenetrateWall(HitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist)
  2102. local HitDist = (HitPos - OriginPos).magnitude
  2103. local Wall, WallHitPos = nil, nil
  2104. local Hum, HumHitPos = nil, nil
  2105. local CustomIgnore = {unpack(Ignore)}
  2106. for i = 1, 10 do
  2107. local WallRay = Ray.new(HitPos - (Direction * 0.1), Direction * S.Penetration)
  2108. local H, P = game.Workspace:FindPartOnRayWithIgnoreList(WallRay, CustomIgnore)
  2109. if H then
  2110. local HitHumanoid = nil
  2111. if H.Parent.ClassName == "Hat" then
  2112. HitHumanoid = findFirstClass(H.Parent.Parent, "Humanoid")
  2113. else
  2114. HitHumanoid = findFirstClass(H.Parent, "Humanoid")
  2115. end
  2116. if HitHumanoid and i ~= 1 then
  2117. Hum, HumHitPos = H, P
  2118. break
  2119. else
  2120. Wall, WallHitPos = H, P
  2121. table.insert(CustomIgnore, H)
  2122. end
  2123. else
  2124. break
  2125. end
  2126. end
  2127. if Wall then
  2128. if S.InstantHit then
  2129. if Hum then
  2130. Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
  2131. return HumHitPos
  2132. else
  2133. local HitObj2, HitPos2 = nil, nil
  2134. if HitHumanoid then
  2135. HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, HitHumanoid.Parent, unpack(Ignore)})
  2136. else
  2137. HitObj2, HitPos2 = AdvRayCast(WallHitPos, Direction, S.BulletRange - HitDist, {Wall, unpack(Ignore)})
  2138. end
  2139. Damage(HitObj2, HitPos2)
  2140.  
  2141. local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
  2142. local NewHitPos2 = HitPos2
  2143. if NewPDist < S.Penetration and HitObj2 then
  2144. NewHitPos2 = PenetrateWall(HitPos2, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
  2145. end
  2146. return NewHitPos2
  2147. end
  2148. else
  2149. local LastPos = WallHitPos
  2150. local TotalDistTraveled = 0
  2151. spawn(function()
  2152. if Hum then
  2153. Damage(Hum.Parent:FindFirstChild("Head"), HumHitPos)
  2154. return HumHitPos
  2155. else
  2156. while true do
  2157. RS.RenderStepped:wait()
  2158. if TotalDistTraveled >= S.BulletRange - HitDist then
  2159. Bullet:Destroy()
  2160. break
  2161. end
  2162. local DistTraveled = (Bullet.Position - LastPos).magnitude
  2163. local NewDirection = (Bullet.Position - LastPos).unit
  2164. local TempHitObj, TempHitPos = nil, nil
  2165. if HitHumanoid then
  2166. TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {Wall, HitHumanoid.Parent, unpack(Ignore)})
  2167. else
  2168. TempHitObj, TempHitPos = AdvRayCast(LastPos, NewDirection, DistTraveled, {Wall, unpack(Ignore)})
  2169. end
  2170. if TempHitObj then
  2171. Damage(TempHitObj, TempHitPos)
  2172.  
  2173. local NewPDist = CurrentPDist + (WallHitPos - HitPos).magnitude
  2174. local NewTempPos = TempHitPos
  2175. if NewPDist < S.Penetration and TempHitObj then
  2176. NewTempPos = PenetrateWall(TempHitPos, Direction, HitHumanoid, OriginPos, Bullet, CurrentPDist + NewPDist)
  2177. else
  2178. Bullet:Destroy()
  2179. end
  2180. return NewTempPos
  2181. else
  2182. LastPos = Bullet.Position
  2183. TotalDistTraveled = TotalDistTraveled + DistTraveled
  2184. end
  2185. end
  2186. end
  2187. end)
  2188. end
  2189. else
  2190. if Bullet then Bullet:Destroy() end
  2191. return HitPos
  2192. end
  2193. end
  2194.  
  2195. function isEnemy(Human)
  2196. local Plyr = game.Players:GetPlayerFromCharacter(Human.Parent)
  2197. if (not Plyr) then return S.CanDamageNPCs end
  2198. return S.AllowFriendlyFire or (Plyr.TeamColor ~= Player.TeamColor or Plyr.Neutral)
  2199. end
  2200.  
  2201. --------------------[ RELOAD FUNCTIONS ]----------------------------------------------
  2202.  
  2203. function animateReload()
  2204. tweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
  2205. tweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
  2206. local magParts = {}
  2207. local magTable = {}
  2208.  
  2209. for _, Obj in pairs(Gun:GetChildren()) do
  2210. if string.sub(Obj.Name, 1, 3) == "Mag" and Obj:IsA("BasePart") then
  2211. INSERT(magParts, Obj)
  2212. end
  2213. end
  2214.  
  2215. local animVars = {
  2216. --FUNCTIONS--
  2217. tweenJoint = tweenJoint;
  2218.  
  2219. makeMagInvisible = function()
  2220. for _, v in pairs(magParts) do
  2221. v.Transparency = 1
  2222. end
  2223. magVisible = false
  2224. end;
  2225.  
  2226. makeMagVisible = function()
  2227. for _, v in pairs(magParts) do
  2228. v.Transparency = v:WaitForChild("magTrans").Value
  2229. end
  2230. magVisible = true
  2231. end;
  2232.  
  2233. isMagVisible = function()
  2234. return magVisible
  2235. end;
  2236.  
  2237. isMagEmpty = function()
  2238. return ammoInClip == 0
  2239. end;
  2240.  
  2241. setNewMag = function()
  2242. newMag = true
  2243. end;
  2244.  
  2245. isNewMag = function()
  2246. return newMag
  2247. end;
  2248.  
  2249. createMag = function(Key)
  2250. local magModel = Instance.new("Model")
  2251. local magClones = {}
  2252. for i, v in pairs(magParts) do
  2253. local vClone = v:Clone()
  2254. vClone.Transparency = v:WaitForChild("magTrans").Value
  2255. vClone.CanCollide = false
  2256. vClone.Parent = magModel
  2257. INSERT(magClones, {Original = v, magClone = vClone})
  2258. if i ~= 1 then
  2259. local W = Instance.new("Weld")
  2260. W.Part0 = magClones[1].magClone
  2261. W.Part1 = vClone
  2262. W.C0 = magClones[1].magClone.CFrame:toObjectSpace(vClone.CFrame)
  2263. W.Parent = magClones[1].magClone
  2264. end
  2265. end
  2266. magTable[Key] = {magModel, magClones}
  2267. return magModel, magClones
  2268. end;
  2269.  
  2270. getMag = function(Key)
  2271. if magTable[Key] then
  2272. return magTable[Key][1], magTable[Key][2]
  2273. else
  2274. return nil, nil
  2275. end
  2276. end;
  2277.  
  2278. attachGripToHead = function()
  2279. local handleCF = RArm.CFrame * Grip.C0
  2280. Grip.C0 = Head.CFrame:toObjectSpace(handleCF)
  2281. Grip.Part0 = Head
  2282. end;
  2283.  
  2284. attachGripToArm = function()
  2285. local handleCF = Head.CFrame * Grip.C0
  2286. Grip.C0 = RArm.CFrame:toObjectSpace(handleCF)
  2287. Grip.Part0 = RArm
  2288. end;
  2289.  
  2290. Sine = Sine;
  2291.  
  2292. Linear = Linear;
  2293.  
  2294. --VARIABLES--
  2295. Handle = Handle;
  2296. LArm = LArm;
  2297. RArm = RArm;
  2298. LWeld = LWeld;
  2299. RWeld = RWeld;
  2300. LC0 = armC0[1];
  2301. RC0 = armC0[2];
  2302. Grip = Grip;
  2303. gunIgnore = gunIgnore;
  2304. Cam = Cam;
  2305. CF = CF;
  2306. CFANG = CFANG;
  2307. V3 = V3;
  2308. RAD = RAD;
  2309. reloadTimeLoaded = S.reloadSettings.Times.Loaded;
  2310. reloadTimeEmpty = S.reloadSettings.Times.Empty
  2311. }
  2312.  
  2313. local sequenceTable = Anims.Reload(animVars)
  2314. --local T = tick()
  2315. for _, reloadFunction in pairs(sequenceTable) do
  2316. if breakReload then
  2317. break
  2318. end
  2319. reloadFunction()
  2320.  
  2321. if (not magVisible) then
  2322. Ammo.Value = 0
  2323. end
  2324. updateClipAmmo()
  2325. end
  2326. --print(tick() - T) --I divide the reloadTime by this number to get the animation speed
  2327.  
  2328. if (not isCrawling) then
  2329. if Running and (not S.canFireWhileRunning) then
  2330. tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
  2331. tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
  2332. tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
  2333. else
  2334. tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
  2335. tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
  2336. tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
  2337. end
  2338. end
  2339.  
  2340. for _, v in pairs(magTable) do --In case the reload animations was stopped mid way and there were still fake mags that weren't deleted
  2341. v[1]:Destroy()
  2342. end
  2343. end
  2344.  
  2345. function Reload()
  2346. if Ammo.Value < (ClipSize.Value + 1) and (not Reloading) and StoredAmmo.Value > 0 then
  2347. Firing = false
  2348. ammoInClip = (ammoInClip == 0 and Ammo.Value or ammoInClip)
  2349. Reloading = true
  2350. lowerSpread()
  2351. if Aimed then unAimGun(S.reloadSettings.Anim) end
  2352. crossHair.Reload.Visible = true
  2353. if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
  2354. if S.reloadSettings.Anim then
  2355. wait()
  2356. animateReload()
  2357. else
  2358. local startReload = tick()
  2359. local initialReloadTime = Ammo.Value == 0 and S.reloadSettings.Times.Empty or S.reloadSettings.Times.Loaded
  2360. while true do
  2361. if breakReload then break end
  2362. if (tick() - startReload) >= initialReloadTime then break end
  2363. RS.RenderStepped:wait()
  2364. end
  2365. end
  2366. if (not breakReload) then
  2367. newMag = false
  2368. if StoredAmmo.Value >= ClipSize.Value then
  2369. if ammoInClip > 0 then
  2370. StoredAmmo.Value = StoredAmmo.Value - ((ClipSize.Value + 1) - ammoInClip)
  2371. Ammo.Value = ClipSize.Value + 1
  2372. else
  2373. StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
  2374. Ammo.Value = ClipSize.Value
  2375. end
  2376. elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
  2377. Ammo.Value = StoredAmmo.Value
  2378. StoredAmmo.Value = 0
  2379. end
  2380. end
  2381. Reloading = false
  2382. if Selected then
  2383. ammoInClip = (breakReload and ammoInClip or 0)
  2384. crossHair.Reload.Visible = false
  2385. end
  2386. breakReload = false
  2387. end
  2388.  
  2389. updateClipAmmo()
  2390. updateStoredAmmo()
  2391. end
  2392.  
  2393. --------------------[ EXTERNAL DATA LOCATING FUNCTIONS ]-----------------------------
  2394.  
  2395. function removeElement(Table, Element) --removes the first instance of Element from Table
  2396. for i, v in pairs(Table) do
  2397. if v == Element then
  2398. table.remove(Table, i)
  2399. break
  2400. end
  2401. end
  2402. return Table
  2403. end
  2404.  
  2405. function findFirstClass(Object, Class)
  2406. local foundObject = nil
  2407. for _, Obj in pairs(Object:GetChildren()) do
  2408. if Obj.ClassName == Class then
  2409. foundObject = Obj
  2410. break
  2411. end
  2412. end
  2413. return foundObject
  2414. end
  2415.  
  2416. function isIgnored(Obj, Table)
  2417. for _,v in pairs(Table) do
  2418. if Obj == v or Obj:IsDescendantOf(v) then
  2419. return true
  2420. end
  2421. end
  2422. return false
  2423. end
  2424.  
  2425. function GetHitSurfaceCFrame(HitPos,Obj)
  2426. local SurfaceCF = {
  2427. {"Back",Obj.CFrame * CF(0,0,Obj.Size.z)};
  2428. {"Bottom",Obj.CFrame * CF(0,-Obj.Size.y,0)};
  2429. {"Front",Obj.CFrame * CF(0,0,-Obj.Size.z)};
  2430. {"Left",Obj.CFrame * CF(-Obj.Size.x,0,0)};
  2431. {"Right",Obj.CFrame * CF(Obj.Size.x,0,0)};
  2432. {"Top",Obj.CFrame * CF(0,Obj.Size.y,0)}
  2433. }
  2434. local ClosestDist = HUGE
  2435. local ClosestSurface = nil
  2436. for _,v in pairs(SurfaceCF) do
  2437. local SurfaceDist = (HitPos - v[2].p).magnitude
  2438. if SurfaceDist < ClosestDist then
  2439. ClosestDist = SurfaceDist
  2440. ClosestSurface = v
  2441. end
  2442. end
  2443. return ClosestSurface[2]
  2444. end
  2445.  
  2446. function AdvRayCast(Origin, Direction, Dist, CustomIgnore)
  2447. local NewIgnore = (CustomIgnore and CustomIgnore or Ignore)
  2448. local NewRay = Ray.new(Origin, Direction * (Dist > 999 and 999 or Dist))
  2449. local HitObj, HitPos = game.Workspace:FindPartOnRayWithIgnoreList(NewRay, NewIgnore)
  2450. local LastPos = HitPos
  2451. local FinalHitObj, FinalHitPos = nil, nil
  2452. local RepTimes = math.floor(Dist / 999)
  2453. if (not HitObj) and (Dist > 999) then
  2454. for i = 0, RepTimes do
  2455. local NewDist = (i == RepTimes and (Dist - (LastPos - Origin).magnitude) or 999)
  2456. local Ray2 = Ray.new(LastPos, Direction * NewDist)
  2457. local HitObj2, HitPos2 = game.Workspace:FindPartOnRayWithIgnoreList(Ray2, NewIgnore)
  2458. if i ~= RepTimes then
  2459. if HitObj2 then
  2460. FinalHitObj, FinalHitPos = HitObj2, HitPos2
  2461. break
  2462. end
  2463. elseif i == RepTimes then
  2464. FinalHitObj, FinalHitPos = HitObj2, HitPos2
  2465. end
  2466. LastPos = HitPos2
  2467. end
  2468. return FinalHitObj, FinalHitPos
  2469. elseif HitObj or (Dist <= 999) then
  2470. return HitObj, HitPos
  2471. end
  2472. end
  2473.  
  2474. --------------------[ JUMPING ANIMATION ]---------------------------------------------
  2475.  
  2476. function onFall(initialVelocity)
  2477. spawn(function()
  2478. local velocityAlpha = math.max(math.min(initialVelocity / Humanoid.JumpPower, 1), 0)
  2479. local startJumpPos = jumpAnim.Pos
  2480. local startJumpRot = jumpAnim.Rot
  2481. local endJumpPos = 0.04 * S.fallSettings.fallMultiplier * velocityAlpha
  2482. local endJumpRot = RAD(4) * S.fallSettings.fallMultiplier * velocityAlpha
  2483. local t0 = tick()
  2484. while true do
  2485. RS.Heartbeat:wait()
  2486. local Alpha = math.min((tick() - t0) / 0.15, 1) * 90
  2487. if onGround then break end
  2488. jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Sine(Alpha))
  2489. jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Sine(Alpha))
  2490. if Alpha == 90 then break end
  2491. end
  2492. startJumpPos = endJumpPos
  2493. startJumpRot = endJumpRot
  2494. endJumpPos = -0.08 * S.fallSettings.fallMultiplier
  2495. endJumpRot = -RAD(8) * S.fallSettings.fallMultiplier
  2496. local X = 1
  2497. while true do
  2498. local dt = RS.Heartbeat:wait()
  2499. X = X + (dt * 60) / X
  2500. local Alpha = (X - 1) / 15
  2501. if onGround then break end
  2502. jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
  2503. jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
  2504. end
  2505. end)
  2506. end
  2507.  
  2508. function onLand(fallDist)
  2509. spawn(function()
  2510. local animAlpha = math.min(fallDist, S.fallSettings.maxDist) * (2 / 3)
  2511. local startJumpPos = jumpAnim.Pos
  2512. local startJumpRot = jumpAnim.Rot
  2513. local endJumpPos = animAlpha / 100 * S.fallSettings.landMultiplier * (runReady and 1 or 2)
  2514. local endJumpRot = RAD(animAlpha) * S.fallSettings.landMultiplier * (runReady and 1 or 2)
  2515. local t0 = tick()
  2516. while true do
  2517. RS.Heartbeat:wait()
  2518. local Alpha = math.min((tick() - t0) / 0.2, 1)
  2519. if (not onGround) then break end
  2520. jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
  2521. jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
  2522. if Alpha == 1 then break end
  2523. end
  2524. t0 = tick()
  2525. while true do
  2526. RS.Heartbeat:wait()
  2527. local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
  2528. if (not onGround) then break end
  2529. jumpAnim.Pos = numLerp(endJumpPos, 0, Sine(Alpha))
  2530. jumpAnim.Rot = numLerp(endJumpRot, 0, Sine(Alpha))
  2531. if Alpha == 90 then break end
  2532. end
  2533. end)
  2534. end
  2535.  
  2536. function onHumanoidStateChanged(oldState, newState)
  2537. if newState == Enum.HumanoidStateType.Freefall then
  2538. onGround = false
  2539. if S.fallAnimation then
  2540. onFall(HRP.Velocity.Y)
  2541. while HRP.Velocity.Y > 0 do RS.RenderStepped:wait() end
  2542. startFallHeight = HRP.Position.Y
  2543. end
  2544. elseif oldState == Enum.HumanoidStateType.Freefall then
  2545. onGround = true
  2546. if S.fallAnimation then
  2547. local fallDist = startFallHeight - HRP.Position.Y
  2548. onLand(fallDist)
  2549. end
  2550. end
  2551. end
  2552. --------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------
  2553.  
  2554. function steadyCamera()
  2555. scopeSteady.Text = "Steadying..."
  2556. scopeSteady.TextColor3 = Color3.new(1, 1, 0)
  2557. camSteady = true
  2558. local originalSway = camSway
  2559. local Increment = 1.5 / 0.6
  2560. local X = 0
  2561. while true do
  2562. RS.RenderStepped:wait()
  2563. local newX = X + Increment
  2564. X = (newX > 90 and 90 or newX)
  2565. if (not steadyKeyPressed) then break end
  2566. camSway = numLerp(originalSway, 0, Sine(X))
  2567. if X == 90 then break end
  2568. end
  2569. while steadyKeyPressed and Aimed do
  2570. if currentSteadyTime > 0 then
  2571. local NewSteadyTime = currentSteadyTime - 1
  2572. currentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
  2573. camSway = 0
  2574. elseif currentSteadyTime == 0 then
  2575. break
  2576. end
  2577. RS.RenderStepped:wait()
  2578. end
  2579. camSteady = false
  2580. spawn(function()
  2581. local Increment = 1.5 / 0.25
  2582. local X = 0
  2583. while true do
  2584. RS.RenderStepped:wait()
  2585. local newX = X + Increment
  2586. X = (newX > 90 and 90 or newX)
  2587. if camSteady then break end
  2588. camSway = numLerp(0, S.scopeSettings.camSwayOnBreath, 1 - COS(RAD(X)))
  2589. if X == 90 then break end
  2590. end
  2591. Increment = 1.5 / S.scopeSettings.breathTime
  2592. X = 0
  2593. while true do
  2594. RS.RenderStepped:wait()
  2595. local newX = X + Increment
  2596. X = (newX > 90 and 90 or newX)
  2597. if camSteady then break end
  2598. camSway = numLerp(S.scopeSettings.camSwayOnBreath, 1, Sine(X))
  2599. if X == 90 then break end
  2600. end
  2601. --[[for X = 0, 90, 1.5 / 0.2 do
  2602. local Alpha = 1 - COS(RAD(X))--math.log10(X) / math.log10(90)
  2603. camSway = numLerp(0, 3, Alpha)
  2604. RS.RenderStepped:wait()
  2605. end]]
  2606. --[[for X = 0, 90, 1.5 / S.scopeSettings.steadyTime do
  2607. if camSteady then break end
  2608. local Alpha = SIN(RAD(X))
  2609. camSway = numLerp(3, 1, Alpha)
  2610. RS.RenderStepped:wait()
  2611. end]]
  2612. end)
  2613. retakeBreath()
  2614. end
  2615.  
  2616. function retakeBreath()
  2617. scopeSteady.Text = "Re-taking Breath"
  2618. scopeSteady.TextColor3 = Color3.new(1, 0, 0)
  2619. takingBreath = true
  2620. local Increment = S.scopeSettings.steadyTime / S.scopeSettings.breathTime
  2621. while takingBreath do
  2622. if currentSteadyTime < maxSteadyTime then
  2623. local newSteadyTime = currentSteadyTime + Increment
  2624. currentSteadyTime = (newSteadyTime > maxSteadyTime and maxSteadyTime or newSteadyTime)
  2625. elseif currentSteadyTime >= maxSteadyTime then
  2626. break
  2627. end
  2628. RS.RenderStepped:wait()
  2629. end
  2630. if takingBreath then
  2631. scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
  2632. scopeSteady.TextColor3 = Color3.new(1, 1, 0)
  2633. takingBreath = false
  2634. end
  2635. end
  2636.  
  2637. --------------------[ SPRINTING FUNCTIONS ]-------------------------------------------
  2638.  
  2639. function canRun(midRun)
  2640. return ((Forward and (not Backward)) and
  2641. Walking and (Stamina > 0) and Running and
  2642. Selected and (midRun and true or onGround) and
  2643. runReady and (S.canFireWhileRunning and true or (not Firing))
  2644. )
  2645. end
  2646.  
  2647. function monitorStamina()
  2648. Running = true
  2649. if (not canRun(false)) then
  2650. Running = false
  2651. return
  2652. end
  2653. if Aimed then unAimGun(true) end
  2654. if Stance == 1 or Stance == 2 then Stand() end
  2655. if (not (Reloading and S.reloadSettings.Anim)) then
  2656. if S.canFireWhileRunning then
  2657. tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
  2658. tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
  2659. tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
  2660. else
  2661. tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
  2662. tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
  2663. tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
  2664. end
  2665. end
  2666. crossOffset = 50
  2667. while runKeyPressed do
  2668. if canRun(true) then
  2669. if onGround then
  2670. local newStamina = Stamina - 1
  2671. Stamina = (newStamina < 0 and 0 or newStamina)
  2672. end
  2673. else
  2674. break
  2675. end
  2676. RS.RenderStepped:wait()
  2677. end
  2678. Running = false
  2679. if (not Aimed) and (not (Reloading and S.reloadSettings.Anim)) and (not S.canFireWhileRunning) then
  2680. crossOffset = 0
  2681. tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
  2682. tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
  2683. tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
  2684. end
  2685.  
  2686. rechargeStamina()
  2687. end
  2688.  
  2689. function rechargeStamina()
  2690. chargingStamina = true
  2691. while ((not runKeyPressed) or (Stamina < maxStamina)) and (not Running) do
  2692. if Stamina < maxStamina then
  2693. local newStamina = Stamina + (S.sprintTime / S.staminaCoolTime)
  2694. Stamina = (newStamina > maxStamina and maxStamina or newStamina)
  2695. elseif Stamina >= maxStamina then
  2696. break
  2697. end
  2698. RS.RenderStepped:wait()
  2699. end
  2700. chargingStamina = false
  2701. end
  2702.  
  2703. --------------------[ STANCE FUNCTIONS ]----------------------------------------------
  2704.  
  2705. function Stand(onDeselected)
  2706. local LHip = Torso["Left Hip"]
  2707. local RHip = Torso["Right Hip"]
  2708. LLegWeld.Part1 = nil
  2709. LHip.Part1 = LLeg
  2710. RLegWeld.Part1 = nil
  2711. RHip.Part1 = RLeg
  2712. Stance = 0
  2713. spreadStance = "Stand"
  2714. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  2715. if S.stanceSettings.Anim and (not onDeselected) then
  2716. spawn(function()
  2717. local prevStanceSway = stanceSway
  2718. local X = 0
  2719. local Increment = 1.5 / S.stanceSettings.Speed
  2720. while true do
  2721. RS.RenderStepped:wait()
  2722. local newX = X + Increment
  2723. X = (newX > 90 and 90 or newX)
  2724. if Stance ~= 0 then break end
  2725. stanceSway = numLerp(prevStanceSway, 1, Sine(X))
  2726. if X == 90 then break end
  2727. end
  2728. end)
  2729. tweenJoint(ABWeld, CF(), nil, Sine, S.stanceSettings.Speed)
  2730. tweenJoint(LLegWeld, legC0.Stand[1], nil, Sine, S.stanceSettings.Speed)
  2731. tweenJoint(RLegWeld, legC0.Stand[2], nil, Sine, S.stanceSettings.Speed)
  2732. tweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, S.stanceSettings.Speed)
  2733. tweenJoint(RHip, CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0), Sine, S.stanceSettings.Speed)
  2734. tweenJoint(Root, CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
  2735. tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
  2736. elseif onDeselected or (not S.stanceSettings.Anim) then
  2737. ABWeld.C0 = CF()
  2738. LLegWeld.C0 = legC0.Stand[1]
  2739. RLegWeld.C0 = legC0.Stand[2]
  2740. LHip.C0, LHip.C1 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
  2741. RHip.C0, RHip.C1 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
  2742. Root.C0 = CFANG(RAD(-90), 0, RAD(180))
  2743. headWeld.C0 = CF(0, 1.5, 0)
  2744. end
  2745. end
  2746.  
  2747. function Crouch()
  2748. local LHip = Torso["Left Hip"]
  2749. local RHip = Torso["Right Hip"]
  2750. LHip.Part1 = nil
  2751. LLegWeld.Part1 = LLeg
  2752. RHip.Part1 = nil
  2753. RLegWeld.Part1 = RLeg
  2754. Stance = 1
  2755. spreadStance = "Crouch"
  2756. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  2757. if S.stanceSettings.Anim then
  2758. spawn(function()
  2759. local prevStanceSway = stanceSway
  2760. local X = 0
  2761. local Increment = 1.5 / S.stanceSettings.Speed
  2762. while true do
  2763. RS.RenderStepped:wait()
  2764. local newX = X + Increment
  2765. X = (newX > 90 and 90 or newX)
  2766. if Stance ~= 1 then break end
  2767. stanceSway = numLerp(prevStanceSway, 0.75, Sine(X))
  2768. if X == 90 then break end
  2769. end
  2770. end)
  2771. tweenJoint(ABWeld, CF(0, 0, -0.05), nil, Sine, S.stanceSettings.Speed)
  2772. tweenJoint(LLegWeld, legC0.Crouch[1], nil, Sine, S.stanceSettings.Speed)
  2773. tweenJoint(RLegWeld, legC0.Crouch[2], nil, Sine, S.stanceSettings.Speed)
  2774. tweenJoint(LHip, CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90)), Sine, S.stanceSettings.Speed)
  2775. tweenJoint(RHip, CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0), Sine, S.stanceSettings.Speed)
  2776. tweenJoint(Root, CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
  2777. tweenJoint(headWeld, CF(0, 1.5, 0), nil, Sine, S.stanceSettings.Speed)
  2778. else
  2779. ABWeld.C0 = CF(0, 0, -1 / 16)
  2780. LLegWeld.C0 = legC0.Crouch[1]
  2781. RLegWeld.C0 = legC0.Crouch[2]
  2782. LHip.C0, LHip.C1 = CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90))
  2783. RHip.C0, RHip.C1 = CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0)
  2784. Root.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, RAD(180))
  2785. headWeld.C0 = CF(0, 1.5, 0)
  2786. end
  2787. end
  2788.  
  2789. function Prone()
  2790. local LHip = Torso["Left Hip"]
  2791. local RHip = Torso["Right Hip"]
  2792. LHip.Part1 = nil
  2793. LLegWeld.Part1 = LLeg
  2794. RHip.Part1 = nil
  2795. RLegWeld.Part1 = RLeg
  2796. Stance = 2
  2797. spreadStance = "Prone"
  2798. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  2799. if S.stanceSettings.Anim then
  2800. spawn(function()
  2801. local prevStanceSway = stanceSway
  2802. local X = 0
  2803. local Increment = 1.5 / S.stanceSettings.Speed
  2804. while true do
  2805. RS.RenderStepped:wait()
  2806. local newX = X + Increment
  2807. X = (newX > 90 and 90 or newX)
  2808. if Stance ~= 2 then break end
  2809. stanceSway = numLerp(prevStanceSway, 0.5, Sine(X))
  2810. if X == 90 then break end
  2811. end
  2812. end)
  2813. tweenJoint(ABWeld, CF(0, 0, -0.1), nil, Sine, S.stanceSettings.Speed)
  2814. tweenJoint(LLegWeld, legC0.Prone[1], nil, Sine, S.stanceSettings.Speed)
  2815. tweenJoint(RLegWeld, legC0.Prone[2], nil, Sine, S.stanceSettings.Speed)
  2816. tweenJoint(Root, CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180)), nil, Sine, S.stanceSettings.Speed)
  2817. tweenJoint(headWeld, CF(0, 1, 1) * CFANG(RAD(90), 0, 0), nil, Sine, S.stanceSettings.Speed)
  2818. else
  2819. ABWeld.C0 = CF(0, 0, -1 / 8)
  2820. LLegWeld.C0 = legC0.Prone[1]
  2821. RLegWeld.C0 = legC0.Prone[2]
  2822. Root.C0 = CF(0, -2.5, 1) * CFANG(RAD(180), 0, RAD(180))
  2823. headWeld.C0 = CF(0, 1, 1) * CFANG(RAD(90), 0, 0)
  2824. end
  2825. end
  2826.  
  2827. function Dive()
  2828. onGround = false
  2829. local diveDirection = (HRP.CFrame * CFANG(S.diveSettings.Angle, 0, 0)).lookVector * S.walkSpeeds.Sprinting * S.diveSettings.Force
  2830. local BF = Instance.new("BodyForce")
  2831. BF.force = diveDirection + Vector3.new(0, playerMass * 196.2, 0)
  2832. BF.Parent = HRP
  2833. --[[spawn(function()
  2834. HRP.Velocity = HRP.CFrame.lookVector * 60 + V3(0, 40, 0)
  2835. wait(0.1)
  2836. HRP.Velocity = HRP.CFrame.lookVector * 70 + V3(0, 30, 0)
  2837. wait(0.4)
  2838. HRP.Velocity = HRP.CFrame.lookVector * 30 + V3(0, -10, 0)
  2839. end)]]
  2840. delay(0.05, function()
  2841. spawn(function()
  2842. while true do
  2843. local newRay = Ray.new(HRP.Position, V3(0, -3.1, 0))
  2844. local H, _ = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
  2845. if H then
  2846. onGround = true
  2847. break
  2848. end
  2849. wait()
  2850. end
  2851. end)
  2852. Prone()
  2853. wait(0.1)
  2854. BF:Destroy()
  2855. end)
  2856. end
  2857.  
  2858. --------------------[ MOUSE FUNCTIONS ]-----------------------------------------------
  2859.  
  2860. function onMB1Down()
  2861. MB1Down = true
  2862. firstShot = true
  2863. if fireFunction then
  2864. fireFunction()
  2865. end
  2866. end
  2867.  
  2868. function onMB1Up()
  2869. MB1Down = false
  2870. lowerSpread()
  2871. end
  2872.  
  2873. function onMB2Down()
  2874. if S.aimSettings.holdToADS then
  2875. if (not AimingIn) and (not Aimed) then
  2876. AimingIn = true
  2877. aimGun()
  2878. AimingIn = false
  2879. end
  2880. else
  2881. if Aimed then
  2882. unAimGun()
  2883. else
  2884. aimGun()
  2885. end
  2886. end
  2887. end
  2888.  
  2889. function onMB2Up()
  2890. if S.aimSettings.holdToADS then
  2891. if (not AimingOut) and Aimed then
  2892. AimingOut = true
  2893. unAimGun()
  2894. AimingOut = false
  2895. end
  2896. end
  2897. end
  2898.  
  2899. function onScrollUp()
  2900. local newAimSensitivity = aimSensitivity + S.sensitivitySettings.Increment
  2901. aimSensitivity = (
  2902. newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
  2903. newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
  2904. newAimSensitivity
  2905. )
  2906. mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
  2907.  
  2908. Sens.Text = "S: "..aimSensitivity
  2909. if mainGUI:IsDescendantOf(game) then
  2910. Sens.Visible = true
  2911. local t0 = tick()
  2912. lastSensUpdate = t0
  2913.  
  2914. wait(0.3)
  2915.  
  2916. if lastSensUpdate <= t0 then
  2917. Sens.Visible = false
  2918. end
  2919. end
  2920. end
  2921.  
  2922. function onScrollDown()
  2923. local newAimSensitivity = aimSensitivity - S.sensitivitySettings.Increment
  2924. aimSensitivity = (
  2925. newAimSensitivity < S.sensitivitySettings.Min and S.sensitivitySettings.Min or
  2926. newAimSensitivity > S.sensitivitySettings.Max and S.sensitivitySettings.Max or
  2927. newAimSensitivity
  2928. )
  2929. mouseSensitivity = (Aimed and aimSensitivity or mouseSensitivity)
  2930.  
  2931. Sens.Text = "S: "..aimSensitivity
  2932. if mainGUI:IsDescendantOf(game) then
  2933. Sens.Visible = true
  2934. local t0 = tick()
  2935. lastSensUpdate = t0
  2936.  
  2937. wait(0.3)
  2938.  
  2939. if lastSensUpdate <= t0 then
  2940. Sens.Visible = false
  2941. end
  2942. end
  2943. end
  2944.  
  2945. --------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------
  2946.  
  2947. function keyDown(K)
  2948. local Key = string.lower(K)
  2949.  
  2950. if Key == S.Keys.lowerStance and S.canChangeStance then
  2951. if (not Running) then
  2952. if Stance == 0 then
  2953. if S.stanceSettings.Stances.Crouch then
  2954. Crouch()
  2955. elseif S.stanceSettings.Stances.Prone then
  2956. Prone()
  2957. end
  2958. elseif Stance == 1 then
  2959. if S.stanceSettings.Stances.Prone then
  2960. Prone()
  2961. end
  2962. end
  2963. elseif S.dolphinDive then
  2964. wait()
  2965. if Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and (not UIS:IsKeyDown("Space")) and runReady then
  2966. local tempConnection = Humanoid.Changed:connect(function()
  2967. Humanoid.Jump = false
  2968. end)
  2969. runReady = false
  2970. Dive()
  2971. Running = false
  2972. wait(S.diveSettings.rechargeTime)
  2973. tempConnection:disconnect()
  2974. runReady = true
  2975. end
  2976. end
  2977. end
  2978.  
  2979. if Key == S.Keys.raiseStance and S.canChangeStance then
  2980. if (not Running) then
  2981. if Stance == 2 then
  2982. if S.stanceSettings.Stances.Crouch then
  2983. Crouch()
  2984. else
  2985. Stand()
  2986. end
  2987. elseif Stance == 1 then
  2988. Stand()
  2989. end
  2990. end
  2991. end
  2992.  
  2993. if Key == S.Keys.ADS then
  2994. if S.aimSettings.holdToADS then
  2995. if (not AimingIn) and (not Aimed) then
  2996. AimingIn = true
  2997. aimGun()
  2998. AimingIn = false
  2999. end
  3000. else
  3001. if Aimed then
  3002. unAimGun()
  3003. else
  3004. aimGun()
  3005. end
  3006. end
  3007. end
  3008.  
  3009. if Key == S.Keys.selectFire and S.selectFire then
  3010. if canSelectFire then
  3011. canSelectFire = false
  3012. rawFireMode = rawFireMode + 1
  3013. modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
  3014. if modeGUI.Text == "AUTO" then
  3015. fireFunction = autoFire
  3016. elseif modeGUI.Text == "BURST" then
  3017. fireFunction = burstFire
  3018. elseif modeGUI.Text == "SEMI" then
  3019. fireFunction = semiFire
  3020. else
  3021. fireFunction = nil
  3022. end
  3023. local speedAlpha = S.selectFireSettings.animSpeed / 0.6
  3024. if S.selectFireSettings.GUI then
  3025. spawn(function()
  3026. fireSelect.Visible = true
  3027. local prevRawFireMode = rawFireMode
  3028. local Increment = 1.5 / (speedAlpha * 0.25)
  3029. local X = 0
  3030. wait(speedAlpha * 0.1)
  3031. while true do
  3032. RS.RenderStepped:wait()
  3033. local newX = X + Increment
  3034. X = (newX > 90 and 90 or newX)
  3035. if prevRawFireMode ~= rawFireMode then break end
  3036. updateModeLabels(rawFireMode - 1, rawFireMode, X)
  3037. if X == 90 then break end
  3038. end
  3039. wait(speedAlpha * 0.25)
  3040. fireSelect.Visible = false
  3041. end)
  3042. end
  3043. if S.selectFireSettings.Animation and (not Aimed) and (not isRunning) and (not isCrawling) then
  3044. spawn(function()
  3045. local sequenceTable = {
  3046. function()
  3047. tweenJoint(RWeld2, nil, CFANG(0, RAD(5), 0), Sine, speedAlpha * 0.15)
  3048. tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-7), 0, RAD(-65)), Linear, speedAlpha * 0.15)
  3049. wait(speedAlpha * 0.2)
  3050. end;
  3051.  
  3052. function()
  3053. tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-10), 0, RAD(-65)), Linear, speedAlpha * 0.1)
  3054. wait(speedAlpha * 0.2)
  3055. end;
  3056.  
  3057. function()
  3058. tweenJoint(RWeld2, nil, CF(), Sine, speedAlpha * 0.2)
  3059. tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, speedAlpha * 0.2)
  3060. wait(speedAlpha * 0.2)
  3061. end;
  3062. }
  3063.  
  3064. for _, F in pairs(sequenceTable) do
  3065. if Aimed or isRunning or isCrawling or Reloading then
  3066. break
  3067. end
  3068. F()
  3069. end
  3070. end)
  3071. end
  3072. if S.selectFireSettings.Animation or S.selectFireSettings.GUI then
  3073. wait(S.selectFireSettings.animSpeed)
  3074. end
  3075. canSelectFire = true
  3076. end
  3077. end
  3078.  
  3079. if Key == S.Keys.Reload then
  3080. if (not Reloading) and (not isCrawling) then
  3081. Reload()
  3082. end
  3083. end
  3084.  
  3085. if Key == S.Keys.Sprint then
  3086. runKeyPressed = true
  3087. if runReady then
  3088. if (not Idling) and Walking and (not Running) and (not Knifing) and (not (Aimed and S.guiScope and S.Keys.Sprint == S.Keys.scopeSteady)) then
  3089. monitorStamina()
  3090. end
  3091. end
  3092. end
  3093.  
  3094. if Key == S.Keys.scopeSteady then
  3095. steadyKeyPressed = true
  3096. if Aimed and (not Aiming) then
  3097. takingBreath = false
  3098. steadyCamera()
  3099. end
  3100. end
  3101.  
  3102. for _, PTable in pairs(Plugins.KeyDown) do
  3103. if Key == string.lower(PTable.Key) then
  3104. spawn(function()
  3105. PTable.Plugin()
  3106. end)
  3107. end
  3108. end
  3109. end
  3110.  
  3111. function keyUp(K)
  3112. local Key = string.lower(K)
  3113.  
  3114. if Key == S.Keys.ADS then
  3115. if S.aimSettings.holdToADS then
  3116. if (not AimingOut) and Aimed then
  3117. AimingOut = true
  3118. unAimGun()
  3119. AimingOut = false
  3120. end
  3121. end
  3122. end
  3123.  
  3124. if Key == S.Keys.Sprint then
  3125. runKeyPressed = false
  3126. Running = false
  3127. if (not chargingStamina) then
  3128. rechargeStamina()
  3129. end
  3130. end
  3131.  
  3132. if Key == S.Keys.scopeSteady then
  3133. steadyKeyPressed = false
  3134. end
  3135.  
  3136. for _, PTable in pairs(Plugins.KeyUp) do
  3137. if Key == string.lower(PTable.Key) then
  3138. spawn(function()
  3139. PTable.Plugin()
  3140. end)
  3141. end
  3142. end
  3143. end
  3144.  
  3145. --------------------[ END FUNCTIONS ]-------------------------------------------------
  3146.  
  3147. --------------------------------------------------------------------------------------
  3148. --------------------[ PRE-CONNECTIONS ]-----------------------------------------------
  3149. --------------------------------------------------------------------------------------
  3150.  
  3151. local function updateAnimVars()
  3152. wait()
  3153. Forward = (UIS:IsKeyDown("W") or UIS:IsKeyDown("Up"))
  3154. Backward = (UIS:IsKeyDown("S") or UIS:IsKeyDown("Down"))
  3155. local Right = UIS:IsKeyDown("D")
  3156. local Left = UIS:IsKeyDown("A")
  3157.  
  3158. local walkingForward = (Forward and (not Backward))
  3159. local walkingBackward = ((not Forward) and Backward)
  3160. local walkingRight = (Right and (not Left))
  3161. local walkingLeft = ((not Right) and Left)
  3162.  
  3163. if (Forward or Backward or Right or Left) then
  3164. Walking, Idling = true, false
  3165. if (not Running) and (not Aimed) then
  3166. spreadMotion = "Moving"
  3167. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  3168. end
  3169. elseif (not (Forward and Backward and Right and Left)) then
  3170. Walking, Idling = false, true
  3171. if (not Aimed) then
  3172. spreadMotion = "Idling"
  3173. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  3174. end
  3175. end
  3176.  
  3177. local newArmTilt = (
  3178. ((walkingForward or walkingBackward) and walkingRight) and 2.5 or
  3179. ((walkingForward or walkingBackward) and walkingLeft) and -2.5 or
  3180. ((not (walkingForward and walkingBackward)) and walkingRight) and 5 or
  3181. ((not (walkingForward and walkingBackward)) and walkingLeft) and -5 or 0
  3182. )
  3183. local newMoveAng = (
  3184. (walkingForward and (not (walkingRight or walkingLeft))) and 0 or
  3185. (walkingForward and walkingRight) and RAD(-45) or
  3186. ((not (walkingForward or walkingBackward)) and walkingRight) and RAD(-90) or
  3187. (walkingBackward and walkingRight) and RAD(-135) or
  3188. (walkingBackward and (not (walkingRight or walkingLeft))) and (moveAng < 0 and RAD(-180) or RAD(180)) or
  3189. (walkingBackward and walkingLeft) and RAD(135) or
  3190. ((not (walkingForward or walkingBackward)) and walkingLeft) and RAD(90) or
  3191. (walkingForward and walkingLeft) and RAD(45) or 0
  3192. )
  3193.  
  3194. local newAnimCode = math.random(-1e9, 1e9)
  3195. animCode = newAnimCode
  3196. local startTilt = armTilt
  3197. local startAng = (ABS(moveAng) == RAD(180)) and (newMoveAng > 0 and RAD(180) or RAD(-180)) or moveAng
  3198. local Increment = (startTilt == newArmTilt and 1.5 / 0.7 or 1.5 / (0.35 * ABS(startTilt - newArmTilt) / 5))
  3199. local X = 0
  3200. while true do
  3201. RS.RenderStepped:wait()
  3202. local newX = X + Increment
  3203. X = (newX > 90 and 90 or newX)
  3204. if animCode ~= newAnimCode then break end
  3205. armTilt = numLerp(startTilt, newArmTilt, Sine(X))
  3206. moveAng = numLerp(startAng, newMoveAng, Sine(X))
  3207. if X == 90 then break end
  3208. end
  3209. end
  3210.  
  3211. M2.KeyDown:connect(updateAnimVars)
  3212. M2.KeyUp:connect(updateAnimVars)
  3213. updateAnimVars()
  3214.  
  3215. --------------------------------------------------------------------------------------
  3216. --------------------[ TOOL SELECTION AND DESELECTION ]--------------------------------
  3217. --------------------------------------------------------------------------------------
  3218.  
  3219. function onEquipped()
  3220. wait()
  3221. if Humanoid.Health ~= 0 and (not Selected) and Gun.Parent == Char then
  3222. Selected = true
  3223. breakReload = false
  3224. equipAnimPlaying = true
  3225.  
  3226. math.randomseed(tick()) --This sets a new seed for the random function each time you select the gun
  3227.  
  3228. --------------------[ FAILSAFE RESETING ]-------------------------------------
  3229.  
  3230. for _, GM in pairs(ignoreModel:GetChildren()) do
  3231. if GM.Name == "gunIgnore_"..Player.Name then
  3232. GM:Destroy()
  3233. end
  3234. end
  3235.  
  3236. for _, c in pairs(Connections) do
  3237. c:disconnect()
  3238. end
  3239.  
  3240. Connections = {}
  3241.  
  3242. --------------------[ REMOTE GUN SETUP ]--------------------------------------
  3243.  
  3244. --[[local Vars = {
  3245. ignoreModel = ignoreModel;
  3246. Humanoid = Humanoid;
  3247. Shoulders = Shoulders;
  3248. Torso = Torso;
  3249. Head = Head;
  3250. armC0 = armC0;
  3251. leftArmC1 = S.equipSettings.leftArmC1;
  3252. rightArmC1 = S.equipSettings.rightArmC1;
  3253. LArm = LArm;
  3254. RArm = RArm;
  3255. gunParts = gunParts;
  3256. Handle = Handle;
  3257. }
  3258. gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, gunParts2 = gunSetup:InvokeServer(Vars)]]
  3259.  
  3260. --------------------[ CREATING IGNORE MODELS ]--------------------------------
  3261.  
  3262. gunIgnore = Instance.new("Model")
  3263. gunIgnore.Name = "gunIgnore_"..Player.Name
  3264. gunIgnore.Parent = ignoreModel
  3265.  
  3266. --------------------[ MODIFYING THE PLAYER ]----------------------------------
  3267.  
  3268. Player.CameraMode = Enum.CameraMode.LockFirstPerson
  3269. Cam.CameraType = Enum.CameraType.Scriptable
  3270. Cam.FieldOfView = 80
  3271. UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
  3272. UIS.MouseIconEnabled = false
  3273.  
  3274. local initialX, initialY = getYawPitch(Cam.CoordinateFrame)
  3275. camAng = -VEC2(initialX, initialY)
  3276.  
  3277. mainGUI.Parent = Player.PlayerGui
  3278.  
  3279. setUpGUI()
  3280. updateHealth()
  3281.  
  3282. if S.selectFire then
  3283. local currentMode = Modes[((rawFireMode - 1) % numModes) + 1]
  3284. if currentMode == "AUTO" then
  3285. fireFunction = autoFire
  3286. elseif currentMode == "BURST" then
  3287. fireFunction = burstFire
  3288. elseif currentMode == "SEMI" then
  3289. fireFunction = semiFire
  3290. else
  3291. fireFunction = nil
  3292. end
  3293. else
  3294. if S.gunType.Semi then
  3295. fireFunction = semiFire
  3296. elseif S.gunType.Auto then
  3297. fireFunction = autoFire
  3298. elseif S.gunType.Burst then
  3299. fireFunction = burstFire
  3300. else
  3301. fireFunction = nil
  3302. end
  3303. end
  3304.  
  3305. changePlayerTrans(Char, 1)
  3306.  
  3307. Humanoid.AutoRotate = false
  3308.  
  3309. Shoulders.Right.Part1 = nil
  3310. Shoulders.Left.Part1 = nil
  3311.  
  3312. playerFolder = Instance.new("Model")
  3313. playerFolder.Name = "playerFolder"
  3314. playerFolder.Parent = gunIgnore
  3315.  
  3316. local headBase = Instance.new("Part")
  3317. headBase.Transparency = 1
  3318. headBase.Name = "headBase"
  3319. headBase.CanCollide = false
  3320. headBase.FormFactor = Enum.FormFactor.Custom
  3321. headBase.Size = V3(0.2, 0.2, 0.2)
  3322. headBase.BottomSurface = Enum.SurfaceType.Smooth
  3323. headBase.TopSurface = Enum.SurfaceType.Smooth
  3324. headBase.Parent = playerFolder
  3325.  
  3326. headWeld = Instance.new("Weld")
  3327. headWeld.Part0 = Torso
  3328. headWeld.Part1 = headBase
  3329. headWeld.C0 = CF(0, 1.5, 0)
  3330. headWeld.Parent = Torso
  3331.  
  3332. headWeld2 = Instance.new("Weld")
  3333. headWeld2.Part0 = headBase
  3334. headWeld2.Part1 = Head
  3335. headWeld2.Parent = headBase
  3336.  
  3337. neckClone = Neck:Clone()
  3338.  
  3339. --[[local stanceBase = Instance.new("Part")
  3340. stanceBase.Transparency = 1
  3341. stanceBase.Name = "stanceBase"
  3342. stanceBase.CanCollide = false
  3343. stanceBase.FormFactor = Enum.FormFactor.Custom
  3344. stanceBase.Size = V3(0.2, 0.2, 0.2)
  3345. stanceBase.BottomSurface = Enum.SurfaceType.Smooth
  3346. stanceBase.TopSurface = Enum.SurfaceType.Smooth
  3347. stanceBase.Parent = playerFolder
  3348.  
  3349. stanceWeld = Instance.new("Weld")
  3350. stanceWeld.Part0 = stanceBase
  3351. stanceWeld.Part1 = Torso
  3352. stanceWeld.Parent = stanceBase]]
  3353.  
  3354. local animBase = Instance.new("Part")
  3355. animBase.Transparency = 1
  3356. animBase.Name = "animBase"
  3357. animBase.CanCollide = false
  3358. animBase.FormFactor = Enum.FormFactor.Custom
  3359. animBase.Size = V3(0.2, 0.2, 0.2)
  3360. animBase.BottomSurface = Enum.SurfaceType.Smooth
  3361. animBase.TopSurface = Enum.SurfaceType.Smooth
  3362. animBase.Parent = playerFolder
  3363.  
  3364. animWeld = Instance.new("Weld")
  3365. animWeld.Part0 = animBase
  3366. animWeld.Part1 = headBase
  3367. animWeld.Parent = animBase
  3368.  
  3369. local ArmBase = Instance.new("Part")
  3370. ArmBase.Transparency = 1
  3371. ArmBase.Name = "ArmBase"
  3372. ArmBase.CanCollide = false
  3373. ArmBase.FormFactor = Enum.FormFactor.Custom
  3374. ArmBase.Size = V3(0.2, 0.2, 0.2)
  3375. ArmBase.BottomSurface = Enum.SurfaceType.Smooth
  3376. ArmBase.TopSurface = Enum.SurfaceType.Smooth
  3377. ArmBase.Parent = playerFolder
  3378.  
  3379. ABWeld = Instance.new("Weld")
  3380. ABWeld.Part0 = ArmBase
  3381. ABWeld.Part1 = animBase
  3382. ABWeld.Parent = ArmBase
  3383.  
  3384. local LArmBase = Instance.new("Part")
  3385. LArmBase.Transparency = 1
  3386. LArmBase.Name = "LArmBase"
  3387. LArmBase.CanCollide = false
  3388. LArmBase.FormFactor = Enum.FormFactor.Custom
  3389. LArmBase.Size = V3(0.2, 0.2, 0.2)
  3390. LArmBase.BottomSurface = Enum.SurfaceType.Smooth
  3391. LArmBase.TopSurface = Enum.SurfaceType.Smooth
  3392. LArmBase.Parent = playerFolder
  3393.  
  3394. local RArmBase = Instance.new("Part")
  3395. RArmBase.Transparency = 1
  3396. RArmBase.Name = "RArmBase"
  3397. RArmBase.CanCollide = false
  3398. RArmBase.FormFactor = Enum.FormFactor.Custom
  3399. RArmBase.Size = V3(0.2, 0.2, 0.2)
  3400. RArmBase.BottomSurface = Enum.SurfaceType.Smooth
  3401. RArmBase.TopSurface = Enum.SurfaceType.Smooth
  3402. RArmBase.Parent = playerFolder
  3403.  
  3404. LWeld = Instance.new("Weld")
  3405. LWeld.Name = "LWeld"
  3406. LWeld.Part0 = ArmBase
  3407. LWeld.Part1 = LArmBase
  3408. LWeld.C0 = armC0[1]
  3409. LWeld.C1 = S.equipSettings.leftArmC1
  3410. LWeld.Parent = ArmBase
  3411.  
  3412. RWeld = Instance.new("Weld")
  3413. RWeld.Name = "RWeld"
  3414. RWeld.Part0 = ArmBase
  3415. RWeld.Part1 = RArmBase
  3416. RWeld.C0 = armC0[2]
  3417. RWeld.C1 = S.equipSettings.rightArmC1
  3418. RWeld.Parent = ArmBase
  3419.  
  3420. LWeld2 = Instance.new("Weld")
  3421. LWeld2.Name = "LWeld"
  3422. LWeld2.Part0 = LArmBase
  3423. LWeld2.Part1 = LArm
  3424. LWeld2.Parent = LArmBase
  3425.  
  3426. RWeld2 = Instance.new("Weld")
  3427. RWeld2.Name = "RWeld"
  3428. RWeld2.Part0 = RArmBase
  3429. RWeld2.Part1 = RArm
  3430. RWeld2.Parent = RArmBase
  3431.  
  3432. LLegWeld = Instance.new("Weld")
  3433. LLegWeld.Name = "LLegWeld"
  3434. LLegWeld.Part0 = Torso
  3435. LLegWeld.Part1 = nil
  3436. LLegWeld.C0 = CF(-0.5, -2, 0)
  3437. LLegWeld.Parent = Torso
  3438.  
  3439. RLegWeld = Instance.new("Weld")
  3440. RLegWeld.Name = "RLegWeld"
  3441. RLegWeld.Part0 = Torso
  3442. RLegWeld.Part1 = nil
  3443. RLegWeld.C0 = CF(0.5, -2, 0)
  3444. RLegWeld.Parent = Torso
  3445.  
  3446. if S.playerArms then
  3447. armModel = Instance.new("Model", workspace.FilteringEnabled and playerFolder or Cam)
  3448.  
  3449. fakeLArm = LArm:Clone()
  3450. fakeLArm.Parent = armModel
  3451. fakeLArm.Transparency = S.fakeArmSettings.Transparency
  3452. fakeLArm.CanCollide = false
  3453. fakeLArm.Size = S.fakeArmSettings.armSize
  3454. fakeLArm:BreakJoints()
  3455.  
  3456. --LArm.Transparency = 1
  3457.  
  3458. local fakeLWeld = Instance.new("Weld")
  3459. fakeLWeld.Part0 = fakeLArm
  3460. fakeLWeld.Part1 = LArm
  3461. fakeLWeld.Parent = fakeLArm
  3462.  
  3463. fakeRArm = RArm:Clone()
  3464. fakeRArm.Parent = armModel
  3465. fakeRArm.Transparency = S.fakeArmSettings.Transparency
  3466. fakeRArm.CanCollide = false
  3467. fakeRArm.Size = S.fakeArmSettings.armSize
  3468. fakeRArm:BreakJoints()
  3469.  
  3470. --RArm.Transparency = 1
  3471.  
  3472. local fakeRWeld = Instance.new("Weld")
  3473. fakeRWeld.Part0 = fakeRArm
  3474. fakeRWeld.Part1 = RArm
  3475. fakeRWeld.Parent = fakeRArm
  3476.  
  3477. Instance.new("Humanoid", armModel)
  3478.  
  3479. if S.fakeArmSettings.characterMeshes then
  3480. for _,Obj in pairs(Char:GetChildren()) do
  3481. if Obj:IsA("CharacterMesh") then
  3482. Obj:Clone().Parent = armModel
  3483. end
  3484. end
  3485. end
  3486. for _,Obj in pairs(Char:GetChildren()) do
  3487. if Obj:IsA("Shirt") then
  3488. Obj:Clone().Parent = armModel
  3489. end
  3490. end
  3491. else
  3492. armTable = createArms()
  3493. if workspace.FilteringEnabled then
  3494. armTable[1].Model.Parent = playerFolder
  3495. armTable[2].Model.Parent = playerFolder
  3496. else
  3497. armTable[1].Model.Parent = Cam--playerFolder
  3498. armTable[2].Model.Parent = Cam--playerFolder
  3499. end
  3500.  
  3501. fakeLArm = armTable[1].armPart
  3502.  
  3503. --LArm.Transparency = 1
  3504.  
  3505. local fakeLWeld = Instance.new("Weld")
  3506. fakeLWeld.Part0 = fakeLArm
  3507. fakeLWeld.Part1 = LArm
  3508. fakeLWeld.Parent = fakeLArm
  3509.  
  3510. fakeRArm = armTable[2].armPart
  3511.  
  3512. --RArm.Transparency = 1
  3513.  
  3514. local fakeRWeld = Instance.new("Weld")
  3515. fakeRWeld.Part0 = fakeRArm
  3516. fakeRWeld.Part1 = RArm
  3517. fakeRWeld.Parent = fakeRArm
  3518. end
  3519.  
  3520. --------------------[ MODIFYING THE GUN ]-------------------------------------
  3521.  
  3522. for _, Tab in pairs(gunParts) do
  3523. local Weld = Instance.new("Weld")
  3524. Weld.Name = "MainWeld"
  3525. Weld.Part0 = Handle
  3526. Weld.Part1 = Tab.Obj
  3527. Weld.C0 = Tab.Obj.weldCF.Value
  3528. Weld.Parent = Handle
  3529. Tab.Weld = Weld
  3530. end
  3531.  
  3532. Grip = RArm:WaitForChild("RightGrip")
  3533.  
  3534. local handleCF = Torso.CFrame * CF(0, 0.5, 0) * armC0[2] * S.aimedC1.rightArm:inverse() * Grip.C0
  3535. local handleOffset = AimPart.CFrame:toObjectSpace(Handle.CFrame)
  3536. aimedGripCF = ((Torso.CFrame * CF(headOffset.X, headOffset.Y, 0)) * handleOffset):toObjectSpace(handleCF)
  3537.  
  3538. Grip.C1 = S.equipSettings.GripC1
  3539.  
  3540. --------------------[ RUNNING PLUGINS ]---------------------------------------
  3541.  
  3542. for _, Plugin in pairs(Plugins.OnEquipped) do
  3543. spawn(function()
  3544. Plugin()
  3545. end)
  3546. end
  3547.  
  3548. --------------------[ GETTING PLAYER MASS ]-----------------------------------
  3549.  
  3550. local connectedParts = HRP:GetConnectedParts(true)
  3551. for _, v in pairs(connectedParts) do
  3552. if v:IsA("BasePart") then
  3553. playerMass = playerMass + v:GetMass()
  3554. end
  3555. end
  3556.  
  3557. --------------------[ CONNECTIONS ]-------------------------------------------
  3558.  
  3559. INSERT(Connections, Humanoid.Died:connect(function()
  3560. onUnequipped(true)
  3561. end))
  3562.  
  3563. INSERT(Connections, Humanoid.Jumping:connect(function()
  3564. if Stance ~= 0 then
  3565. Stand()
  3566. end
  3567. end))
  3568.  
  3569. INSERT(Connections, Humanoid.StateChanged:connect(onHumanoidStateChanged))
  3570.  
  3571. INSERT(Connections, Humanoid.HealthChanged:connect(updateHealth))
  3572.  
  3573. INSERT(Connections, M2.Button1Down:connect(onMB1Down))
  3574.  
  3575. INSERT(Connections, M2.Button1Up:connect(onMB1Up))
  3576.  
  3577. INSERT(Connections, M2.Button2Down:connect(onMB2Down))
  3578.  
  3579. INSERT(Connections, M2.Button2Up:connect(onMB2Up))
  3580.  
  3581. INSERT(Connections, M2.KeyDown:connect(keyDown))
  3582.  
  3583. INSERT(Connections, M2.KeyUp:connect(keyUp))
  3584.  
  3585. if S.sensitivitySettings.scrollToChange then
  3586. INSERT(Connections, M2.WheelForward:connect(onScrollUp))
  3587. INSERT(Connections, M2.WheelBackward:connect(onScrollDown))
  3588. end
  3589.  
  3590. if S.AutoKnife then
  3591. INSERT(Connections, RS.Stepped:connect(function()
  3592. local H, P = AdvRayCast(Head.CFrame.p, Head.CFrame.lookVector, S.AutoKnifeDist, nil)
  3593. if H then
  3594. local HitHuman = findFirstClass(H.Parent, "Humanoid")
  3595. if HitHuman and isEnemy(HitHuman) and HitHuman.Health ~= 0 then
  3596. Knife()
  3597. end
  3598. end
  3599. end))
  3600. end
  3601.  
  3602. INSERT(Connections, UIS.InputChanged:connect(function(inputObj)
  3603. if inputObj.UserInputType == Enum.UserInputType.MouseMovement then
  3604. local rawCamAng = camAng - (VEC2(RAD(inputObj.Delta.x), RAD(inputObj.Delta.y)) * mouseSensitivity * 0.25)
  3605. camAng = VEC2(rawCamAng.x, (rawCamAng.y > RAD(80) and RAD(80) or rawCamAng.y < RAD(-80) and RAD(-80) or rawCamAng.y))
  3606.  
  3607. desiredXOffset = math.min(math.max(inputObj.Delta.x, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
  3608. desiredYOffset = math.min(math.max(inputObj.Delta.y, -S.momentumSettings.maxInput), S.momentumSettings.maxInput)
  3609. end
  3610. end))
  3611.  
  3612. INSERT(Connections, M2.Idle:connect(function(inputObj)
  3613. desiredXOffset = 0
  3614. desiredYOffset = 0
  3615. end))
  3616.  
  3617. INSERT(Connections, RS.Stepped:connect(function()
  3618. if tick() - lastBeat > (Humanoid.Health / 75) then
  3619. lastBeat = tick()
  3620. HUD.Health.Tray.Beat:TweenPosition(
  3621. UDim2.new(0, -21, 0, 0),
  3622. Enum.EasingDirection.Out,
  3623. Enum.EasingStyle.Linear,
  3624. 0.7 - ((100 - Humanoid.Health) / 400),
  3625. false,
  3626. function()
  3627. HUD.Health.Tray.Beat.Position = UDim2.new(1, 0, 0, 0)
  3628. end
  3629. )
  3630. end
  3631. end))
  3632.  
  3633. INSERT(Connections, RS.RenderStepped:connect(function()
  3634. --Main animation
  3635. local animC0, animC1 = getAnimCF()
  3636. animWeld.C0 = animC0
  3637. animWeld.C1 = animC1
  3638.  
  3639. --Camera updating
  3640. renderCamera()
  3641. end))
  3642.  
  3643. --------------------[ ANIMATE GUN ]-------------------------------------------
  3644.  
  3645. tweenJoint(LWeld, nil, S.unAimedC1.leftArm, Sine, S.equipSettings.Time)
  3646. tweenJoint(RWeld, nil, S.unAimedC1.rightArm, Sine, S.equipSettings.Time)
  3647. tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, S.equipSettings.Time)
  3648. spawn(function()
  3649. local T = tick()
  3650. while true do
  3651. if tick() - T > S.equipSettings.Time then break end
  3652. if (not Selected) then break end
  3653. wait()
  3654. end
  3655. equipAnimPlaying = false
  3656. end)
  3657.  
  3658. Animate()
  3659. end
  3660. end
  3661.  
  3662. function onUnequipped(deleteTool)
  3663. if Selected then
  3664. Selected = false
  3665.  
  3666. breakReload = true
  3667.  
  3668. --------------------[ RUNNING PLUGINS ]---------------------------------------
  3669.  
  3670. for _, Plugin in pairs(Plugins.OnUnEquipped) do
  3671. spawn(function()
  3672. Plugin()
  3673. end)
  3674. end
  3675.  
  3676. --------------------[ MODIFYING THE PLAYER ]----------------------------------
  3677.  
  3678. Cam.FieldOfView = 70
  3679. Cam.CameraType = Enum.CameraType.Custom
  3680.  
  3681. UIS.MouseBehavior = Enum.MouseBehavior.Default
  3682. UIS.MouseIconEnabled = true
  3683.  
  3684. Player.CameraMode = Enum.CameraMode.Classic
  3685.  
  3686. if armTable then
  3687. armTable[1].Model:Destroy()
  3688. armTable[2].Model:Destroy()
  3689. elseif armModel then
  3690. armModel:Destroy()
  3691. end
  3692.  
  3693. LLegWeld:Destroy()
  3694. RLegWeld:Destroy()
  3695.  
  3696. changePlayerTrans(Char, 0)
  3697.  
  3698. mainGUI.Parent = script
  3699.  
  3700. Shoulders.Right.Part1 = RArm
  3701. Shoulders.Left.Part1 = LArm
  3702.  
  3703. neckClone.Parent = Torso
  3704. headWeld:Destroy()
  3705.  
  3706. Humanoid.WalkSpeed = 16
  3707. Humanoid.AutoRotate = true
  3708.  
  3709. --------------------[ RESETING THE TOOL ]-------------------------------------
  3710.  
  3711. gunIgnore:Destroy()
  3712.  
  3713. mouseSensitivity = S.sensitivitySettings.Default
  3714.  
  3715. MB1Down = false
  3716.  
  3717. playerMass = 0
  3718.  
  3719. Aimed = false
  3720.  
  3721. camOffsets = {
  3722. guiScope = {
  3723. Rot = V3();
  3724. };
  3725. Reload = {
  3726. Rot = V3();
  3727. Code = nil;
  3728. };
  3729. Recoil = {
  3730. Rot = V3();
  3731. Code = nil;
  3732. };
  3733. }
  3734.  
  3735. recoilAnim = {
  3736. Pos = V3();
  3737. Rot = V3();
  3738. Code = nil;
  3739. }
  3740.  
  3741. --Setting the aim variables to unaimed
  3742. spreadZoom = "unAimed"
  3743. scopeMain.Visible = false
  3744. scopeSteady.Visible = false
  3745. aimAlpha = 0
  3746. aimHeadOffset = 0
  3747. jumpAnimMultiplier = 1
  3748. translationDivisor = 7
  3749. rotationMultiplier = S.momentumSettings.Amplitude.unAimed
  3750. armTiltMultiplier = 1
  3751. Scope.BackgroundTransparency = 1
  3752. if S.guiScope then
  3753. spawn(function()
  3754. for _, Obj in pairs(Gun:GetChildren()) do
  3755. if Obj:IsA("BasePart") then
  3756. Obj.LocalTransparencyModifier = 0
  3757. end
  3758. end
  3759. end)
  3760. end
  3761.  
  3762. onGround = true
  3763.  
  3764. for _, Tab in pairs(gunParts) do
  3765. Tab.Weld:Destroy()
  3766. Tab.Weld = nil
  3767. end
  3768.  
  3769. for _,c in pairs(Connections) do
  3770. c:disconnect()
  3771. end
  3772.  
  3773. Connections = {}
  3774.  
  3775. if deleteTool then
  3776. Cam:ClearAllChildren()
  3777. Gun:Destroy()
  3778. end
  3779.  
  3780. wait() --This is here in case you dolphin dived and deselected the tool instantly
  3781.  
  3782. if S.stanceSettings.standOnDeselect and Stance ~= 0 then
  3783. crawlCamRot = 0
  3784. isCrawling = false
  3785. stanceSway = 1
  3786. spreadStance = "Stand"
  3787. Stand(true)
  3788. end
  3789. baseSpread = S.spreadSettings[spreadZoom][spreadStance][spreadMotion]
  3790. end
  3791. end
  3792.  
  3793. Gun.Equipped:connect(onEquipped)
  3794. Gun.Unequipped:connect(function() onUnequipped(false) end)
  3795.  
  3796. --------------------------------------------------------------------------------------
  3797. --------------------[ END PROGRAM ]---------------------------------------------------
  3798. --------------------------------------------------------------------------------------
  3799. end))
  3800. IntValue7.Name = "ignoreCode"
  3801. IntValue7.Parent = LocalScript6
  3802. Folder8.Name = "Server_Scripts"
  3803. Folder8.Parent = LocalScript6
  3804. ScreenGui9.Name = "mainGUI"
  3805. ScreenGui9.Parent = LocalScript6
  3806. Frame10.Name = "fireSelect"
  3807. Frame10.Parent = ScreenGui9
  3808. Frame10.Transparency = 1
  3809. Frame10.Position = UDim2.new(0.5, 0, 0.5, -18)
  3810. Frame10.Visible = false
  3811. Frame10.BackgroundColor3 = Color3.new(1, 1, 1)
  3812. Frame10.BackgroundTransparency = 1
  3813. Frame11.Name = "Modes"
  3814. Frame11.Parent = Frame10
  3815. Frame11.Transparency = 1
  3816. Frame11.BackgroundColor3 = Color3.new(1, 1, 1)
  3817. Frame11.BackgroundTransparency = 1
  3818. ImageLabel12.Name = "Circle"
  3819. ImageLabel12.Parent = Frame10
  3820. ImageLabel12.Transparency = 1
  3821. ImageLabel12.Size = UDim2.new(0, 120, 0, 120)
  3822. ImageLabel12.Position = UDim2.new(0, -60, 0, -60)
  3823. ImageLabel12.BackgroundColor3 = Color3.new(1, 1, 1)
  3824. ImageLabel12.BackgroundTransparency = 1
  3825. ImageLabel12.Image = "http://www.roblox.com/asset/?id=55754953"
  3826. ImageLabel12.ImageTransparency = 0.5
  3827. ImageLabel13.Name = "Arrow"
  3828. ImageLabel13.Parent = Frame10
  3829. ImageLabel13.Transparency = 1
  3830. ImageLabel13.Size = UDim2.new(0, 40, 0, 20)
  3831. ImageLabel13.Position = UDim2.new(0, -20, 0, -140)
  3832. ImageLabel13.BackgroundColor3 = Color3.new(1, 1, 1)
  3833. ImageLabel13.BackgroundTransparency = 1
  3834. ImageLabel13.Image = "http://www.roblox.com/asset/?id=126877530"
  3835. TextLabel14.Name = "Sens"
  3836. TextLabel14.Parent = ScreenGui9
  3837. TextLabel14.Transparency = 1
  3838. TextLabel14.Size = UDim2.new(0, 100, 0, 20)
  3839. TextLabel14.Text = "S: 0.3"
  3840. TextLabel14.Position = UDim2.new(0.5, -50, 0.5, 50)
  3841. TextLabel14.Visible = false
  3842. TextLabel14.BackgroundColor3 = Color3.new(1, 1, 1)
  3843. TextLabel14.BackgroundTransparency = 1
  3844. TextLabel14.ZIndex = 10
  3845. TextLabel14.Font = Enum.Font.SourceSansBold
  3846. TextLabel14.FontSize = Enum.FontSize.Size28
  3847. TextLabel14.TextColor3 = Color3.new(1, 1, 1)
  3848. TextLabel14.TextStrokeTransparency = 0
  3849. Frame15.Name = "Scope"
  3850. Frame15.Parent = ScreenGui9
  3851. Frame15.Transparency = 1
  3852. Frame15.Size = UDim2.new(1, 0, 1, 36)
  3853. Frame15.Position = UDim2.new(0, 0, 0, -36)
  3854. Frame15.BackgroundColor3 = Color3.new(0, 0, 0)
  3855. Frame15.BackgroundTransparency = 1
  3856. TextLabel16.Name = "Steady"
  3857. TextLabel16.Parent = Frame15
  3858. TextLabel16.Transparency = 1
  3859. TextLabel16.Size = UDim2.new(0, 120, 0, 20)
  3860. TextLabel16.Text = ""
  3861. TextLabel16.Position = UDim2.new(0.5, -60, 0.5, 50)
  3862. TextLabel16.Visible = false
  3863. TextLabel16.BackgroundColor3 = Color3.new(1, 1, 1)
  3864. TextLabel16.BackgroundTransparency = 1
  3865. TextLabel16.ZIndex = 9
  3866. TextLabel16.Font = Enum.Font.ArialBold
  3867. TextLabel16.FontSize = Enum.FontSize.Size14
  3868. TextLabel16.TextColor3 = Color3.new(1, 1, 0)
  3869. TextLabel16.TextStrokeTransparency = 0
  3870. Frame17.Name = "Main"
  3871. Frame17.Parent = Frame15
  3872. Frame17.Transparency = 1
  3873. Frame17.Size = UDim2.new(1, 0, 1, 0)
  3874. Frame17.Visible = false
  3875. Frame17.BackgroundColor3 = Color3.new(1, 1, 1)
  3876. Frame17.BackgroundTransparency = 1
  3877. ImageLabel18.Name = "ScopeImg2"
  3878. ImageLabel18.Parent = Frame17
  3879. ImageLabel18.Transparency = 1
  3880. ImageLabel18.Size = UDim2.new(0, 20, 0, 20)
  3881. ImageLabel18.Position = UDim2.new(0.5, -10, 0, -10)
  3882. ImageLabel18.BackgroundColor3 = Color3.new(0, 0, 0)
  3883. ImageLabel18.BackgroundTransparency = 1
  3884. ImageLabel18.Image = "http://www.roblox.com/asset/?id=184922644"
  3885. ImageLabel19.Name = "ScopeImg1"
  3886. ImageLabel19.Parent = Frame17
  3887. ImageLabel19.Transparency = 1
  3888. ImageLabel19.Size = UDim2.new(0, 20, 0, 20)
  3889. ImageLabel19.Position = UDim2.new(0.5, -10, 0, -10)
  3890. ImageLabel19.BackgroundColor3 = Color3.new(0, 0, 0)
  3891. ImageLabel19.BackgroundTransparency = 1
  3892. ImageLabel19.Image = "http://www.roblox.com/asset/?id=72002022"
  3893. Frame20.Name = "F2"
  3894. Frame20.Parent = Frame17
  3895. Frame20.Size = UDim2.new(0, 0, 1, 20)
  3896. Frame20.Position = UDim2.new(0, -10, 0, -10)
  3897. Frame20.BackgroundColor3 = Color3.new(0, 0, 0)
  3898. Frame20.BorderColor3 = Color3.new(0, 0, 0)
  3899. Frame20.BorderSizePixel = 0
  3900. Frame21.Name = "F1"
  3901. Frame21.Parent = Frame17
  3902. Frame21.Size = UDim2.new(0, 0, 1, 20)
  3903. Frame21.Position = UDim2.new(0, -10, 0, -10)
  3904. Frame21.BackgroundColor3 = Color3.new(0, 0, 0)
  3905. Frame21.BorderColor3 = Color3.new(0, 0, 0)
  3906. Frame21.BorderSizePixel = 0
  3907. LocalScript22.Name = "Update"
  3908. LocalScript22.Parent = Frame17
  3909. table.insert(cors,sandbox(LocalScript22,function()
  3910. local GUI = script.Parent
  3911.  
  3912. function updateScopeDimension()
  3913. GUI.ScopeImg1.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
  3914. GUI.ScopeImg1.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
  3915. GUI.ScopeImg2.Position = UDim2.new(0.5, -10 - (GUI.AbsoluteSize.y / 2), 0, -10)
  3916. GUI.ScopeImg2.Size = UDim2.new(0, 20 + GUI.AbsoluteSize.y, 0, 20 + GUI.AbsoluteSize.y)
  3917. GUI.F1.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
  3918. GUI.F2.Size = UDim2.new(0, 20 + ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 1, 20)
  3919. GUI.F2.Position = UDim2.new(1, -10 - ((GUI.AbsoluteSize.x - GUI.AbsoluteSize.y) / 2), 0, -10)
  3920. end
  3921.  
  3922. wait()
  3923.  
  3924. GUI.Changed:connect(updateScopeDimension)
  3925.  
  3926. updateScopeDimension()
  3927. end))
  3928. ImageLabel23.Name = "HUD"
  3929. ImageLabel23.Parent = ScreenGui9
  3930. ImageLabel23.Transparency = 1
  3931. ImageLabel23.Size = UDim2.new(0, 100, 0, 100)
  3932. ImageLabel23.Position = UDim2.new(1, -210, 1, -125)
  3933. ImageLabel23.BackgroundColor3 = Color3.new(1, 1, 1)
  3934. ImageLabel23.BackgroundTransparency = 1
  3935. ImageLabel23.Image = "rbxassetid://500188818"
  3936. ImageLabel23.ImageColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3937. ImageLabel23.ImageTransparency = 0.30000001192093
  3938. Frame24.Parent = ImageLabel23
  3939. Frame24.Transparency = 0.30000001192093
  3940. Frame24.Size = UDim2.new(0, 110, 0, 100)
  3941. Frame24.Position = UDim2.new(0, 100, 0, 0)
  3942. Frame24.Active = true
  3943. Frame24.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  3944. Frame24.BackgroundTransparency = 0.30000001192093
  3945. Frame24.BorderSizePixel = 0
  3946. Frame25.Name = "Controls"
  3947. Frame25.Parent = ImageLabel23
  3948. Frame25.Transparency = 0.30000001192093
  3949. Frame25.Size = UDim2.new(1, 0, 0, 120)
  3950. Frame25.Position = UDim2.new(0, 0, 0, -200)
  3951. Frame25.Visible = false
  3952. Frame25.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3953. Frame25.BackgroundTransparency = 0.30000001192093
  3954. Frame25.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3955. Frame25.BorderSizePixel = 5
  3956. Frame25.ZIndex = 10
  3957. TextLabel26.Name = "Title"
  3958. TextLabel26.Parent = Frame25
  3959. TextLabel26.Transparency = 1
  3960. TextLabel26.Size = UDim2.new(1, 0, 0, 15)
  3961. TextLabel26.Text = "CONTROLS"
  3962. TextLabel26.BackgroundColor3 = Color3.new(1, 1, 1)
  3963. TextLabel26.BackgroundTransparency = 1
  3964. TextLabel26.ZIndex = 10
  3965. TextLabel26.Font = Enum.Font.SourceSansBold
  3966. TextLabel26.FontSize = Enum.FontSize.Size14
  3967. TextLabel26.TextColor3 = Color3.new(1, 1, 1)
  3968. TextLabel27.Name = "Line"
  3969. TextLabel27.Parent = TextLabel26
  3970. TextLabel27.Size = UDim2.new(1, 0, 0, 2)
  3971. TextLabel27.Text = ""
  3972. TextLabel27.Position = UDim2.new(0, 0, 1, 1)
  3973. TextLabel27.BackgroundColor3 = Color3.new(1, 1, 0)
  3974. TextLabel27.BorderSizePixel = 0
  3975. TextLabel27.ZIndex = 10
  3976. TextLabel27.Font = Enum.Font.SourceSans
  3977. TextLabel27.FontSize = Enum.FontSize.Size14
  3978. Frame28.Name = "Grenades"
  3979. Frame28.Parent = ImageLabel23
  3980. Frame28.Transparency = 1
  3981. Frame28.Size = UDim2.new(0, 175, 0, 25)
  3982. Frame28.Position = UDim2.new(0, 0, 0, 90)
  3983. Frame28.Visible = false
  3984. Frame28.BackgroundTransparency = 1
  3985. Frame28.ZIndex = 10
  3986. Frame29.Name = "Lethals"
  3987. Frame29.Parent = Frame28
  3988. Frame29.Size = UDim2.new(0.5, -2, 1, 0)
  3989. Frame29.BackgroundColor3 = Color3.new(1, 1, 1)
  3990. Frame29.BorderSizePixel = 0
  3991. Frame29.ZIndex = 10
  3992. ImageLabel30.Name = "Icon"
  3993. ImageLabel30.Parent = Frame29
  3994. ImageLabel30.Transparency = 1
  3995. ImageLabel30.Size = UDim2.new(0, 21, 0, 21)
  3996. ImageLabel30.Position = UDim2.new(0, 7, 0, 2)
  3997. ImageLabel30.BackgroundColor3 = Color3.new(1, 1, 1)
  3998. ImageLabel30.BackgroundTransparency = 1
  3999. ImageLabel30.ZIndex = 10
  4000. TextLabel31.Name = "Mult"
  4001. TextLabel31.Parent = Frame29
  4002. TextLabel31.Transparency = 1
  4003. TextLabel31.Size = UDim2.new(0, 20, 1, 0)
  4004. TextLabel31.Text = "X"
  4005. TextLabel31.Position = UDim2.new(0.5, -10, 0, 0)
  4006. TextLabel31.BackgroundColor3 = Color3.new(1, 1, 1)
  4007. TextLabel31.BackgroundTransparency = 1
  4008. TextLabel31.BorderSizePixel = 0
  4009. TextLabel31.ZIndex = 10
  4010. TextLabel31.Font = Enum.Font.ArialBold
  4011. TextLabel31.FontSize = Enum.FontSize.Size18
  4012. TextLabel31.TextColor3 = Color3.new(0, 0, 0)
  4013. TextLabel32.Name = "Num"
  4014. TextLabel32.Parent = Frame29
  4015. TextLabel32.Transparency = 1
  4016. TextLabel32.Size = UDim2.new(0, 0, 1, 0)
  4017. TextLabel32.Text = "0"
  4018. TextLabel32.Position = UDim2.new(1, -7, 0, 0)
  4019. TextLabel32.BackgroundColor3 = Color3.new(1, 1, 1)
  4020. TextLabel32.BackgroundTransparency = 1
  4021. TextLabel32.ZIndex = 10
  4022. TextLabel32.Font = Enum.Font.ArialBold
  4023. TextLabel32.FontSize = Enum.FontSize.Size18
  4024. TextLabel32.TextColor3 = Color3.new(0, 0, 0)
  4025. TextLabel32.TextXAlignment = Enum.TextXAlignment.Right
  4026. Frame33.Name = "Tacticals"
  4027. Frame33.Parent = Frame28
  4028. Frame33.Size = UDim2.new(0.5, -2, 1, 0)
  4029. Frame33.Position = UDim2.new(0.5, 2, 0, 0)
  4030. Frame33.BackgroundColor3 = Color3.new(1, 1, 1)
  4031. Frame33.BorderSizePixel = 0
  4032. Frame33.ZIndex = 10
  4033. ImageLabel34.Name = "Icon"
  4034. ImageLabel34.Parent = Frame33
  4035. ImageLabel34.Transparency = 1
  4036. ImageLabel34.Size = UDim2.new(0, 21, 0, 21)
  4037. ImageLabel34.Position = UDim2.new(0, 7, 0, 2)
  4038. ImageLabel34.BackgroundColor3 = Color3.new(1, 1, 1)
  4039. ImageLabel34.BackgroundTransparency = 1
  4040. ImageLabel34.ZIndex = 10
  4041. TextLabel35.Name = "Num"
  4042. TextLabel35.Parent = Frame33
  4043. TextLabel35.Transparency = 1
  4044. TextLabel35.Size = UDim2.new(0, 0, 1, 0)
  4045. TextLabel35.Text = "0"
  4046. TextLabel35.Position = UDim2.new(1, -7, 0, 0)
  4047. TextLabel35.BackgroundColor3 = Color3.new(1, 1, 1)
  4048. TextLabel35.BackgroundTransparency = 1
  4049. TextLabel35.ZIndex = 10
  4050. TextLabel35.Font = Enum.Font.ArialBold
  4051. TextLabel35.FontSize = Enum.FontSize.Size18
  4052. TextLabel35.TextColor3 = Color3.new(0, 0, 0)
  4053. TextLabel35.TextXAlignment = Enum.TextXAlignment.Right
  4054. TextLabel36.Name = "Mult"
  4055. TextLabel36.Parent = Frame33
  4056. TextLabel36.Transparency = 1
  4057. TextLabel36.Size = UDim2.new(0, 20, 1, 0)
  4058. TextLabel36.Text = "X"
  4059. TextLabel36.Position = UDim2.new(0.5, -10, 0, 0)
  4060. TextLabel36.BackgroundColor3 = Color3.new(1, 1, 1)
  4061. TextLabel36.BackgroundTransparency = 1
  4062. TextLabel36.BorderSizePixel = 0
  4063. TextLabel36.ZIndex = 10
  4064. TextLabel36.Font = Enum.Font.ArialBold
  4065. TextLabel36.FontSize = Enum.FontSize.Size18
  4066. TextLabel36.TextColor3 = Color3.new(0, 0, 0)
  4067. Frame37.Name = "Health"
  4068. Frame37.Parent = ImageLabel23
  4069. Frame37.Transparency = 1
  4070. Frame37.Size = UDim2.new(0.400000006, 0, 0, 25)
  4071. Frame37.Position = UDim2.new(0, 25, 0, 20)
  4072. Frame37.BackgroundColor3 = Color3.new(0.247059, 0.247059, 0.247059)
  4073. Frame37.BackgroundTransparency = 1
  4074. Frame37.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  4075. Frame37.BorderSizePixel = 0
  4076. Frame37.ZIndex = 10
  4077. Frame37.Draggable = true
  4078. TextLabel38.Name = "Num"
  4079. TextLabel38.Parent = Frame37
  4080. TextLabel38.Transparency = 1
  4081. TextLabel38.Size = UDim2.new(0, 50, 1, 0)
  4082. TextLabel38.Text = "100%"
  4083. TextLabel38.Position = UDim2.new(1, -50, 0, 0)
  4084. TextLabel38.BackgroundColor3 = Color3.new(0, 0, 0)
  4085. TextLabel38.BackgroundTransparency = 1
  4086. TextLabel38.BorderColor3 = Color3.new(0, 0, 0)
  4087. TextLabel38.BorderSizePixel = 0
  4088. TextLabel38.ZIndex = 10
  4089. TextLabel38.Font = Enum.Font.SourceSansBold
  4090. TextLabel38.FontSize = Enum.FontSize.Size24
  4091. TextLabel38.TextColor3 = Color3.new(1, 1, 1)
  4092. TextLabel38.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  4093. TextLabel38.TextXAlignment = Enum.TextXAlignment.Right
  4094. Frame39.Name = "Tray"
  4095. Frame39.Parent = Frame37
  4096. Frame39.Transparency = 1
  4097. Frame39.Size = UDim2.new(1, -60, 0, 20)
  4098. Frame39.Position = UDim2.new(0, 2, 0.5, -10)
  4099. Frame39.Visible = false
  4100. Frame39.BackgroundColor3 = Color3.new(0, 0, 0)
  4101. Frame39.BackgroundTransparency = 1
  4102. Frame39.BorderColor3 = Color3.new(0, 0, 0)
  4103. Frame39.BorderSizePixel = 0
  4104. Frame39.ZIndex = 10
  4105. Frame39.ClipsDescendants = true
  4106. Frame40.Name = "Beat"
  4107. Frame40.Parent = Frame39
  4108. Frame40.Transparency = 1
  4109. Frame40.Size = UDim2.new(0, 21, 1, 0)
  4110. Frame40.Position = UDim2.new(1, 0, 0, 0)
  4111. Frame40.BackgroundColor3 = Color3.new(0, 0, 0)
  4112. Frame40.BackgroundTransparency = 1
  4113. Frame40.BorderColor3 = Color3.new(0, 0, 0)
  4114. Frame40.BorderSizePixel = 0
  4115. Frame40.ZIndex = 10
  4116. Frame41.Name = "00"
  4117. Frame41.Parent = Frame40
  4118. Frame41.Size = UDim2.new(0.0476190485, 0, 0, 3)
  4119. Frame41.Position = UDim2.new(0, 0, 0.5, -2)
  4120. Frame41.BackgroundColor3 = Color3.new(1, 1, 1)
  4121. Frame41.BorderColor3 = Color3.new(0, 0, 0)
  4122. Frame41.BorderSizePixel = 0
  4123. Frame41.ZIndex = 10
  4124. Frame42.Name = "01"
  4125. Frame42.Parent = Frame40
  4126. Frame42.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4127. Frame42.Position = UDim2.new(0.0476190485, 0, 0.423076928, -2)
  4128. Frame42.BackgroundColor3 = Color3.new(1, 1, 1)
  4129. Frame42.BorderColor3 = Color3.new(0, 0, 0)
  4130. Frame42.BorderSizePixel = 0
  4131. Frame42.ZIndex = 10
  4132. Frame43.Name = "02"
  4133. Frame43.Parent = Frame40
  4134. Frame43.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4135. Frame43.Position = UDim2.new(0.095238097, 0, 0.346153855, -2)
  4136. Frame43.BackgroundColor3 = Color3.new(1, 1, 1)
  4137. Frame43.BorderColor3 = Color3.new(0, 0, 0)
  4138. Frame43.BorderSizePixel = 0
  4139. Frame43.ZIndex = 10
  4140. Frame44.Name = "03"
  4141. Frame44.Parent = Frame40
  4142. Frame44.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4143. Frame44.Position = UDim2.new(0.142857149, 0, 0.269230783, -2)
  4144. Frame44.BackgroundColor3 = Color3.new(1, 1, 1)
  4145. Frame44.BorderColor3 = Color3.new(0, 0, 0)
  4146. Frame44.BorderSizePixel = 0
  4147. Frame44.ZIndex = 10
  4148. Frame45.Name = "04"
  4149. Frame45.Parent = Frame40
  4150. Frame45.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4151. Frame45.Position = UDim2.new(0.190476194, 0, 0.192307696, -2)
  4152. Frame45.BackgroundColor3 = Color3.new(1, 1, 1)
  4153. Frame45.BorderColor3 = Color3.new(0, 0, 0)
  4154. Frame45.BorderSizePixel = 0
  4155. Frame45.ZIndex = 10
  4156. Frame46.Name = "05"
  4157. Frame46.Parent = Frame40
  4158. Frame46.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4159. Frame46.Position = UDim2.new(0.238095239, 0, 0.115384616, -2)
  4160. Frame46.BackgroundColor3 = Color3.new(1, 1, 1)
  4161. Frame46.BorderColor3 = Color3.new(0, 0, 0)
  4162. Frame46.BorderSizePixel = 0
  4163. Frame46.ZIndex = 10
  4164. Frame47.Name = "06"
  4165. Frame47.Parent = Frame40
  4166. Frame47.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4167. Frame47.Position = UDim2.new(0.285714298, 0, 0.0384615399, -2)
  4168. Frame47.BackgroundColor3 = Color3.new(1, 1, 1)
  4169. Frame47.BorderColor3 = Color3.new(0, 0, 0)
  4170. Frame47.BorderSizePixel = 0
  4171. Frame47.ZIndex = 10
  4172. Frame48.Name = "07"
  4173. Frame48.Parent = Frame40
  4174. Frame48.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4175. Frame48.Position = UDim2.new(0.333333343, 0, 0, -2)
  4176. Frame48.BackgroundColor3 = Color3.new(1, 1, 1)
  4177. Frame48.BorderColor3 = Color3.new(0, 0, 0)
  4178. Frame48.BorderSizePixel = 0
  4179. Frame48.ZIndex = 10
  4180. Frame49.Name = "08"
  4181. Frame49.Parent = Frame40
  4182. Frame49.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4183. Frame49.Position = UDim2.new(0.380952388, 0, 0.142857149, -2)
  4184. Frame49.BackgroundColor3 = Color3.new(1, 1, 1)
  4185. Frame49.BorderColor3 = Color3.new(0, 0, 0)
  4186. Frame49.BorderSizePixel = 0
  4187. Frame49.ZIndex = 10
  4188. Frame50.Name = "09"
  4189. Frame50.Parent = Frame40
  4190. Frame50.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4191. Frame50.Position = UDim2.new(0.428571433, 0, 0.285714298, -2)
  4192. Frame50.BackgroundColor3 = Color3.new(1, 1, 1)
  4193. Frame50.BorderColor3 = Color3.new(0, 0, 0)
  4194. Frame50.BorderSizePixel = 0
  4195. Frame50.ZIndex = 10
  4196. Frame51.Name = "10"
  4197. Frame51.Parent = Frame40
  4198. Frame51.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4199. Frame51.Position = UDim2.new(0.476190478, 0, 0.428571433, -2)
  4200. Frame51.BackgroundColor3 = Color3.new(1, 1, 1)
  4201. Frame51.BorderColor3 = Color3.new(0, 0, 0)
  4202. Frame51.BorderSizePixel = 0
  4203. Frame51.ZIndex = 10
  4204. Frame52.Name = "11"
  4205. Frame52.Parent = Frame40
  4206. Frame52.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4207. Frame52.Position = UDim2.new(0.523809552, 0, 0.571428597, -2)
  4208. Frame52.BackgroundColor3 = Color3.new(1, 1, 1)
  4209. Frame52.BorderColor3 = Color3.new(0, 0, 0)
  4210. Frame52.BorderSizePixel = 0
  4211. Frame52.ZIndex = 10
  4212. Frame53.Name = "12"
  4213. Frame53.Parent = Frame40
  4214. Frame53.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4215. Frame53.Position = UDim2.new(0.571428597, 0, 0.714285731, -2)
  4216. Frame53.BackgroundColor3 = Color3.new(1, 1, 1)
  4217. Frame53.BorderColor3 = Color3.new(0, 0, 0)
  4218. Frame53.BorderSizePixel = 0
  4219. Frame53.ZIndex = 10
  4220. Frame54.Name = "13"
  4221. Frame54.Parent = Frame40
  4222. Frame54.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4223. Frame54.Position = UDim2.new(0.619047642, 0, 0.857142866, -2)
  4224. Frame54.BackgroundColor3 = Color3.new(1, 1, 1)
  4225. Frame54.BorderColor3 = Color3.new(0, 0, 0)
  4226. Frame54.BorderSizePixel = 0
  4227. Frame54.ZIndex = 10
  4228. Frame55.Name = "14"
  4229. Frame55.Parent = Frame40
  4230. Frame55.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4231. Frame55.Position = UDim2.new(0.666666687, 0, 0.916666687, -2)
  4232. Frame55.BackgroundColor3 = Color3.new(1, 1, 1)
  4233. Frame55.BorderColor3 = Color3.new(0, 0, 0)
  4234. Frame55.BorderSizePixel = 0
  4235. Frame55.ZIndex = 10
  4236. Frame56.Name = "15"
  4237. Frame56.Parent = Frame40
  4238. Frame56.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4239. Frame56.Position = UDim2.new(0.714285731, 0, 0.833333313, -2)
  4240. Frame56.BackgroundColor3 = Color3.new(1, 1, 1)
  4241. Frame56.BorderColor3 = Color3.new(0, 0, 0)
  4242. Frame56.BorderSizePixel = 0
  4243. Frame56.ZIndex = 10
  4244. Frame57.Name = "16"
  4245. Frame57.Parent = Frame40
  4246. Frame57.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4247. Frame57.Position = UDim2.new(0.761904776, 0, 0.75, -2)
  4248. Frame57.BackgroundColor3 = Color3.new(1, 1, 1)
  4249. Frame57.BorderColor3 = Color3.new(0, 0, 0)
  4250. Frame57.BorderSizePixel = 0
  4251. Frame57.ZIndex = 10
  4252. Frame58.Name = "17"
  4253. Frame58.Parent = Frame40
  4254. Frame58.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4255. Frame58.Position = UDim2.new(0.809523821, 0, 0.666666687, -2)
  4256. Frame58.BackgroundColor3 = Color3.new(1, 1, 1)
  4257. Frame58.BorderColor3 = Color3.new(0, 0, 0)
  4258. Frame58.BorderSizePixel = 0
  4259. Frame58.ZIndex = 10
  4260. Frame59.Name = "18"
  4261. Frame59.Parent = Frame40
  4262. Frame59.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4263. Frame59.Position = UDim2.new(0.857142866, 0, 0.583333313, -2)
  4264. Frame59.BackgroundColor3 = Color3.new(1, 1, 1)
  4265. Frame59.BorderColor3 = Color3.new(0, 0, 0)
  4266. Frame59.BorderSizePixel = 0
  4267. Frame59.ZIndex = 10
  4268. Frame60.Name = "19"
  4269. Frame60.Parent = Frame40
  4270. Frame60.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4271. Frame60.Position = UDim2.new(0.90476191, 0, 0.5, -2)
  4272. Frame60.BackgroundColor3 = Color3.new(1, 1, 1)
  4273. Frame60.BorderColor3 = Color3.new(0, 0, 0)
  4274. Frame60.BorderSizePixel = 0
  4275. Frame60.ZIndex = 10
  4276. Frame61.Name = "20"
  4277. Frame61.Parent = Frame40
  4278. Frame61.Size = UDim2.new(0.0476190485, 0, 0, 4)
  4279. Frame61.Position = UDim2.new(0.952000022, 0, 0.49000001, -2)
  4280. Frame61.BackgroundColor3 = Color3.new(1, 1, 1)
  4281. Frame61.BorderColor3 = Color3.new(0, 0, 0)
  4282. Frame61.BorderSizePixel = 0
  4283. Frame61.ZIndex = 10
  4284. Frame62.Name = "Line"
  4285. Frame62.Parent = Frame40
  4286. Frame62.Size = UDim2.new(0, 200, 0, 3)
  4287. Frame62.Position = UDim2.new(1, 0, 0.5, -2)
  4288. Frame62.BackgroundColor3 = Color3.new(1, 1, 1)
  4289. Frame62.BorderColor3 = Color3.new(0, 0, 0)
  4290. Frame62.BorderSizePixel = 0
  4291. Frame62.ZIndex = 10
  4292. Frame63.Name = "Line"
  4293. Frame63.Parent = Frame40
  4294. Frame63.Size = UDim2.new(0, 200, 0, 3)
  4295. Frame63.Position = UDim2.new(0, -200, 0.5, -2)
  4296. Frame63.BackgroundColor3 = Color3.new(1, 1, 1)
  4297. Frame63.BorderColor3 = Color3.new(0, 0, 0)
  4298. Frame63.BorderSizePixel = 0
  4299. Frame63.ZIndex = 10
  4300. Frame64.Name = "Mode"
  4301. Frame64.Parent = ImageLabel23
  4302. Frame64.Transparency = 1
  4303. Frame64.Size = UDim2.new(0, 85, 0, 20)
  4304. Frame64.Position = UDim2.new(1, 22, 1, -60)
  4305. Frame64.BackgroundColor3 = Color3.new(1, 1, 1)
  4306. Frame64.BackgroundTransparency = 1
  4307. Frame64.ZIndex = 10
  4308. TextLabel65.Name = "Bracket"
  4309. TextLabel65.Parent = Frame64
  4310. TextLabel65.Transparency = 1
  4311. TextLabel65.Size = UDim2.new(0, 5, 0, 20)
  4312. TextLabel65.Text = "["
  4313. TextLabel65.BackgroundTransparency = 1
  4314. TextLabel65.ZIndex = 10
  4315. TextLabel65.Font = Enum.Font.ArialBold
  4316. TextLabel65.FontSize = Enum.FontSize.Size18
  4317. TextLabel65.TextColor3 = Color3.new(1, 1, 1)
  4318. TextLabel65.TextXAlignment = Enum.TextXAlignment.Left
  4319. TextLabel66.Name = "Bracket"
  4320. TextLabel66.Parent = Frame64
  4321. TextLabel66.Transparency = 1
  4322. TextLabel66.Size = UDim2.new(0, 5, 0, 20)
  4323. TextLabel66.Text = "]"
  4324. TextLabel66.Position = UDim2.new(1, -5, 0, 0)
  4325. TextLabel66.BackgroundTransparency = 1
  4326. TextLabel66.ZIndex = 10
  4327. TextLabel66.Font = Enum.Font.ArialBold
  4328. TextLabel66.FontSize = Enum.FontSize.Size18
  4329. TextLabel66.TextColor3 = Color3.new(1, 1, 1)
  4330. TextLabel66.TextXAlignment = Enum.TextXAlignment.Left
  4331. TextLabel67.Name = "Main"
  4332. TextLabel67.Parent = Frame64
  4333. TextLabel67.Transparency = 1
  4334. TextLabel67.Size = UDim2.new(1, 0, 0, 20)
  4335. TextLabel67.Text = "Auto"
  4336. TextLabel67.BackgroundTransparency = 1
  4337. TextLabel67.ZIndex = 10
  4338. TextLabel67.Font = Enum.Font.SourceSansItalic
  4339. TextLabel67.FontSize = Enum.FontSize.Size18
  4340. TextLabel67.TextColor3 = Color3.new(1, 1, 1)
  4341. TextLabel67.TextWrapped = true
  4342. Frame68.Name = "gunName"
  4343. Frame68.Parent = ImageLabel23
  4344. Frame68.Transparency = 1
  4345. Frame68.Size = UDim2.new(1, 0, 0, 36)
  4346. Frame68.BackgroundColor3 = Color3.new(0.352941, 0.352941, 0.352941)
  4347. Frame68.BackgroundTransparency = 1
  4348. Frame68.ZIndex = 10
  4349. TextLabel69.Name = "Title"
  4350. TextLabel69.Parent = Frame68
  4351. TextLabel69.Transparency = 1
  4352. TextLabel69.Size = UDim2.new(1, 75, 1, 0)
  4353. TextLabel69.Text = "GUN"
  4354. TextLabel69.Position = UDim2.new(0, 30, 0, -5)
  4355. TextLabel69.BackgroundColor3 = Color3.new(1, 1, 1)
  4356. TextLabel69.BackgroundTransparency = 1
  4357. TextLabel69.ZIndex = 10
  4358. TextLabel69.Font = Enum.Font.SourceSansItalic
  4359. TextLabel69.FontSize = Enum.FontSize.Size36
  4360. TextLabel69.TextColor3 = Color3.new(1, 1, 1)
  4361. TextLabel69.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  4362. TextLabel69.TextStrokeTransparency = 0
  4363. TextLabel69.TextWrapped = true
  4364. TextLabel69.TextXAlignment = Enum.TextXAlignment.Left
  4365. Frame70.Name = "Ammo"
  4366. Frame70.Parent = ImageLabel23
  4367. Frame70.Transparency = 1
  4368. Frame70.Size = UDim2.new(0, 135, 0, 40)
  4369. Frame70.Position = UDim2.new(0, 72, 0, 60)
  4370. Frame70.BackgroundTransparency = 1
  4371. Frame70.ZIndex = 10
  4372. TextLabel71.Name = "Slash"
  4373. TextLabel71.Parent = Frame70
  4374. TextLabel71.Transparency = 1
  4375. TextLabel71.Size = UDim2.new(0, 0, 0, 45)
  4376. TextLabel71.Text = "//"
  4377. TextLabel71.Position = UDim2.new(0, 92, 0, -12)
  4378. TextLabel71.BackgroundTransparency = 1
  4379. TextLabel71.ZIndex = 10
  4380. TextLabel71.Font = Enum.Font.SourceSansBold
  4381. TextLabel71.FontSize = Enum.FontSize.Size24
  4382. TextLabel71.TextColor3 = Color3.new(1, 1, 1)
  4383. TextLabel72.Name = "Stored"
  4384. TextLabel72.Parent = Frame70
  4385. TextLabel72.Transparency = 1
  4386. TextLabel72.Size = UDim2.new(1, 0, 0, 85)
  4387. TextLabel72.Text = "999"
  4388. TextLabel72.Position = UDim2.new(0, 100, 0, -35)
  4389. TextLabel72.BackgroundTransparency = 1
  4390. TextLabel72.ZIndex = 10
  4391. TextLabel72.Font = Enum.Font.SourceSansBold
  4392. TextLabel72.FontSize = Enum.FontSize.Size28
  4393. TextLabel72.TextColor3 = Color3.new(1, 1, 1)
  4394. TextLabel72.TextXAlignment = Enum.TextXAlignment.Left
  4395. TextLabel73.Name = "Background"
  4396. TextLabel73.Parent = TextLabel72
  4397. TextLabel73.Transparency = 1
  4398. TextLabel73.Size = UDim2.new(1, 0, 1, 0)
  4399. TextLabel73.Text = "000"
  4400. TextLabel73.BackgroundTransparency = 1
  4401. TextLabel73.ZIndex = 10
  4402. TextLabel73.Font = Enum.Font.ArialBold
  4403. TextLabel73.FontSize = Enum.FontSize.Size24
  4404. TextLabel73.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
  4405. TextLabel73.TextTransparency = 0.80000001192093
  4406. TextLabel73.TextWrapped = true
  4407. TextLabel73.TextXAlignment = Enum.TextXAlignment.Left
  4408. TextLabel74.Name = "Clip"
  4409. TextLabel74.Parent = Frame70
  4410. TextLabel74.Transparency = 1
  4411. TextLabel74.Size = UDim2.new(0, 85, 1, 0)
  4412. TextLabel74.Text = "999"
  4413. TextLabel74.Position = UDim2.new(0, 0, 0, -5)
  4414. TextLabel74.BackgroundTransparency = 1
  4415. TextLabel74.ZIndex = 10
  4416. TextLabel74.Font = Enum.Font.SourceSansBold
  4417. TextLabel74.FontSize = Enum.FontSize.Size60
  4418. TextLabel74.TextColor3 = Color3.new(1, 1, 1)
  4419. TextLabel74.TextXAlignment = Enum.TextXAlignment.Right
  4420. TextLabel75.Name = "Background"
  4421. TextLabel75.Parent = TextLabel74
  4422. TextLabel75.Transparency = 1
  4423. TextLabel75.Size = UDim2.new(1, 0, 1, 0)
  4424. TextLabel75.Text = "000"
  4425. TextLabel75.BackgroundTransparency = 1
  4426. TextLabel75.ZIndex = 10
  4427. TextLabel75.Font = Enum.Font.SourceSansBold
  4428. TextLabel75.FontSize = Enum.FontSize.Size60
  4429. TextLabel75.TextColor3 = Color3.new(0.588235, 0.588235, 0.588235)
  4430. TextLabel75.TextTransparency = 0.80000001192093
  4431. TextLabel75.TextXAlignment = Enum.TextXAlignment.Right
  4432. ImageLabel76.Name = "Bear"
  4433. ImageLabel76.Parent = ImageLabel23
  4434. ImageLabel76.Transparency = 1
  4435. ImageLabel76.Rotation = -10
  4436. ImageLabel76.Size = UDim2.new(0, 80, 0, 50)
  4437. ImageLabel76.Position = UDim2.new(0, 100, 0, 5)
  4438. ImageLabel76.Visible = false
  4439. ImageLabel76.BackgroundColor3 = Color3.new(1, 1, 1)
  4440. ImageLabel76.BackgroundTransparency = 1
  4441. ImageLabel76.Image = "rbxassetid://500200470"
  4442. ImageLabel76.ImageTransparency = 0.69999998807907
  4443. TextLabel77.Parent = ImageLabel76
  4444. TextLabel77.Transparency = 1
  4445. TextLabel77.Rotation = 10
  4446. TextLabel77.Size = UDim2.new(1, 0, 1, 0)
  4447. TextLabel77.Text = "~BoG~"
  4448. TextLabel77.BackgroundColor3 = Color3.new(1, 1, 1)
  4449. TextLabel77.BackgroundTransparency = 1
  4450. TextLabel77.Font = Enum.Font.SourceSansItalic
  4451. TextLabel77.FontSize = Enum.FontSize.Size24
  4452. TextLabel77.TextColor3 = Color3.new(1, 1, 1)
  4453. TextLabel77.TextStrokeColor3 = Color3.new(0.745098, 0.745098, 0.745098)
  4454. TextLabel77.TextStrokeTransparency = 0.89999997615814
  4455. TextLabel77.TextTransparency = 0.89999997615814
  4456. TextLabel77.TextWrapped = true
  4457. Frame78.Name = "crossHair"
  4458. Frame78.Parent = ScreenGui9
  4459. Frame78.Position = UDim2.new(0.5, 0, 0.5, -18)
  4460. Frame78.BackgroundColor3 = Color3.new(1, 1, 1)
  4461. Frame78.BorderColor3 = Color3.new(0, 0, 0)
  4462. Frame78.BorderSizePixel = 0
  4463. ImageLabel79.Parent = Frame78
  4464. ImageLabel79.Transparency = 1
  4465. ImageLabel79.Size = UDim2.new(0, 300, 0, 300)
  4466. ImageLabel79.Position = UDim2.new(0, -150, 0, -150)
  4467. ImageLabel79.Visible = false
  4468. ImageLabel79.BackgroundColor3 = Color3.new(1, 1, 1)
  4469. ImageLabel79.BackgroundTransparency = 1
  4470. ImageLabel79.ZIndex = 2
  4471. ImageLabel79.Image = "http://www.roblox.com/asset/?id=68308747"
  4472. TextLabel80.Name = "Reload"
  4473. TextLabel80.Parent = Frame78
  4474. TextLabel80.Transparency = 1
  4475. TextLabel80.Size = UDim2.new(0, 100, 0, 20)
  4476. TextLabel80.Text = "RELOADING..."
  4477. TextLabel80.Position = UDim2.new(0, -50, 0, 70)
  4478. TextLabel80.Visible = false
  4479. TextLabel80.BackgroundColor3 = Color3.new(1, 1, 1)
  4480. TextLabel80.BackgroundTransparency = 1
  4481. TextLabel80.ZIndex = 2
  4482. TextLabel80.Font = Enum.Font.SourceSansBold
  4483. TextLabel80.FontSize = Enum.FontSize.Size18
  4484. TextLabel80.TextColor3 = Color3.new(1, 1, 1)
  4485. TextLabel80.TextStrokeTransparency = 0.5
  4486. Frame81.Name = "C"
  4487. Frame81.Parent = Frame78
  4488. Frame81.Transparency = 1
  4489. Frame81.Size = UDim2.new(0, 4, 0, 500)
  4490. Frame81.Position = UDim2.new(0, -2, 0, 0)
  4491. Frame81.BackgroundColor3 = Color3.new(1, 1, 1)
  4492. Frame81.BackgroundTransparency = 1
  4493. Frame81.ClipsDescendants = true
  4494. TextLabel82.Name = "Line"
  4495. TextLabel82.Parent = Frame81
  4496. TextLabel82.Size = UDim2.new(0, 2, 0, 15)
  4497. TextLabel82.Text = ""
  4498. TextLabel82.Position = UDim2.new(0.5, -1, 0, 10)
  4499. TextLabel82.BackgroundColor3 = Color3.new(1, 1, 1)
  4500. TextLabel82.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
  4501. TextLabel82.Font = Enum.Font.SourceSans
  4502. TextLabel82.FontSize = Enum.FontSize.Size14
  4503. Frame83.Name = "A"
  4504. Frame83.Parent = Frame78
  4505. Frame83.Transparency = 1
  4506. Frame83.Size = UDim2.new(0, 4, 0, 500)
  4507. Frame83.Position = UDim2.new(0, -2, 0, -500)
  4508. Frame83.BackgroundColor3 = Color3.new(1, 1, 1)
  4509. Frame83.BackgroundTransparency = 1
  4510. Frame83.ClipsDescendants = true
  4511. TextLabel84.Name = "Line"
  4512. TextLabel84.Parent = Frame83
  4513. TextLabel84.Size = UDim2.new(0, 2, 0, 15)
  4514. TextLabel84.Text = ""
  4515. TextLabel84.Position = UDim2.new(0.5, -1, 1, -25)
  4516. TextLabel84.BackgroundColor3 = Color3.new(1, 1, 1)
  4517. TextLabel84.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
  4518. TextLabel84.Font = Enum.Font.SourceSans
  4519. TextLabel84.FontSize = Enum.FontSize.Size14
  4520. Frame85.Name = "B"
  4521. Frame85.Parent = Frame78
  4522. Frame85.Transparency = 1
  4523. Frame85.Size = UDim2.new(0, 500, 0, 4)
  4524. Frame85.Position = UDim2.new(0, 0, 0, -2)
  4525. Frame85.BackgroundColor3 = Color3.new(1, 1, 1)
  4526. Frame85.BackgroundTransparency = 1
  4527. Frame85.ClipsDescendants = true
  4528. TextLabel86.Name = "Line"
  4529. TextLabel86.Parent = Frame85
  4530. TextLabel86.Size = UDim2.new(0, 15, 0, 2)
  4531. TextLabel86.Text = ""
  4532. TextLabel86.Position = UDim2.new(0, 10, 0.5, -1)
  4533. TextLabel86.BackgroundColor3 = Color3.new(1, 1, 1)
  4534. TextLabel86.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
  4535. TextLabel86.Font = Enum.Font.SourceSans
  4536. TextLabel86.FontSize = Enum.FontSize.Size14
  4537. Frame87.Name = "D"
  4538. Frame87.Parent = Frame78
  4539. Frame87.Transparency = 1
  4540. Frame87.Size = UDim2.new(0, 500, 0, 4)
  4541. Frame87.Position = UDim2.new(0, -500, 0, -2)
  4542. Frame87.BackgroundColor3 = Color3.new(1, 1, 1)
  4543. Frame87.BackgroundTransparency = 1
  4544. Frame87.ClipsDescendants = true
  4545. TextLabel88.Name = "Line"
  4546. TextLabel88.Parent = Frame87
  4547. TextLabel88.Size = UDim2.new(0, 15, 0, 2)
  4548. TextLabel88.Text = ""
  4549. TextLabel88.Position = UDim2.new(1, -25, 0.5, -1)
  4550. TextLabel88.BackgroundColor3 = Color3.new(1, 1, 1)
  4551. TextLabel88.BorderColor3 = Color3.new(0.392157, 0.392157, 0.392157)
  4552. TextLabel88.Font = Enum.Font.SourceSans
  4553. TextLabel88.FontSize = Enum.FontSize.Size14
  4554. ImageLabel89.Name = "hitMarker"
  4555. ImageLabel89.Parent = ScreenGui9
  4556. ImageLabel89.Transparency = 1
  4557. ImageLabel89.Size = UDim2.new(0, 26, 0, 26)
  4558. ImageLabel89.Position = UDim2.new(0.5, -13, 0.5, -31)
  4559. ImageLabel89.Visible = false
  4560. ImageLabel89.BackgroundTransparency = 1
  4561. ImageLabel89.ZIndex = 10
  4562. ImageLabel89.Image = "http://www.roblox.com/asset/?id=121173757"
  4563. NumberValue90.Name = "lastMark"
  4564. NumberValue90.Parent = ImageLabel89
  4565. ManualWeld91.Name = "BoltBack-to-Bolt Strong Joint"
  4566. ManualWeld91.Parent = mas
  4567. ManualWeld91.C0 = CFrame.new(-0.450004131, 0.0100045428, 0.450034529, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  4568. ManualWeld91.C1 = CFrame.new(-0.45000723, 0.00988769531, 0.450006604, -1, -1.38405858e-05, 1.47198193e-07, 1.47277945e-07, -5.76107504e-06, 1, -1.38405858e-05, 1, 5.76107686e-06)
  4569. ManualWeld91.Part0 = nil
  4570. ManualWeld91.Part1 = nil
  4571. ManualWeld92.Name = "BoltBack-to-Bolt Strong Joint"
  4572. ManualWeld92.Parent = mas
  4573. ManualWeld92.C0 = CFrame.new(-0.450004131, 0.0100045428, 0.450034529, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  4574. ManualWeld92.C1 = CFrame.new(-0.450006843, 0.00988769531, -0.450013578, 2.4346029e-05, -1, -5.91436674e-06, 4.9242044e-07, -5.91435401e-06, 1, -1, -2.43460327e-05, 4.92276456e-07)
  4575. ManualWeld92.Part0 = nil
  4576. ManualWeld92.Part1 = nil
  4577. ManualWeld93.Name = "BoltBack-to-Bolt Strong Joint"
  4578. ManualWeld93.Parent = mas
  4579. ManualWeld93.C0 = CFrame.new(-0.450004131, 0.0100045428, 0.450034529, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  4580. ManualWeld93.C1 = CFrame.new(0.450007975, 0.0100097656, -0.450009227, 1, 1.71570737e-05, -8.86241323e-05, 8.86203052e-05, 0.000222758361, 1, 1.71768152e-05, -1, 0.000222756833)
  4581. ManualWeld93.Part0 = nil
  4582. ManualWeld93.Part1 = nil
  4583. ManualWeld94.Name = "Grip-to-Mag Strong Joint"
  4584. ManualWeld94.Parent = mas
  4585. ManualWeld94.C0 = CFrame.new(-0.0500058718, 0.325030416, 0.275049001, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  4586. ManualWeld94.C1 = CFrame.new(0.155041948, -0.244948864, -0.32598877, -0.999999344, -9.25453321e-07, -9.56245003e-07, 1.47485207e-06, 1.98302951e-05, 0.999997318, -7.79967422e-07, 0.999999642, -2.5720281e-05)
  4587. ManualWeld94.Part0 = nil
  4588. ManualWeld94.Part1 = nil
  4589. ManualWeld95.Name = "Grip-to-Mag Strong Joint"
  4590. ManualWeld95.Parent = mas
  4591. ManualWeld95.C0 = CFrame.new(-0.0500058718, 0.325030416, 0.275049001, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  4592. ManualWeld95.C1 = CFrame.new(-0.254958034, -0.244948864, -0.32598877, -0.999999344, -9.25453321e-07, -9.56245003e-07, 1.47485207e-06, 1.98302951e-05, 0.999997318, -7.79967422e-07, 0.999999642, -2.5720281e-05)
  4593. ManualWeld95.Part0 = nil
  4594. ManualWeld95.Part1 = nil
  4595. ManualWeld96.Name = "Grip2-to-Grip2 Strong Joint"
  4596. ManualWeld96.Parent = mas
  4597. ManualWeld96.C0 = CFrame.new(0.0500004217, -0.375047863, -0.150044665, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  4598. ManualWeld96.C1 = CFrame.new(0.0499951318, -0.20008862, 0.0249023438, -1, 4.84741759e-06, 2.91045694e-07, 4.84742077e-06, 1, 1.15486564e-05, -2.90989675e-07, 1.15486573e-05, -1)
  4599. ManualWeld96.Part0 = nil
  4600. ManualWeld96.Part1 = nil
  4601. Script97.Name = "serverMain"
  4602. Script97.Parent = Tool0
  4603. table.insert(cors,sandbox(Script97,function()
  4604. local Plyr = script:WaitForChild("Plyr")
  4605.  
  4606. local Gun = script.Parent
  4607. local Handle = Gun:WaitForChild("Handle")
  4608.  
  4609. local V3 = Vector3.new
  4610. local CF, CFANG = CFrame.new, CFrame.Angles
  4611.  
  4612. local RAD = math.rad
  4613.  
  4614. local numLerp = function(A, B, Alpha)
  4615. return A + (B - A) * Alpha
  4616. end
  4617.  
  4618. local inList = function(Element, List)
  4619. for _, v in pairs(List) do
  4620. if v == Element then
  4621. return true
  4622. end
  4623. end
  4624. return false
  4625. end
  4626.  
  4627. local getObject = function(Model, Class, Name)
  4628. for _, v in pairs(Model:GetChildren()) do
  4629. if v:IsA(Class) and v.Name == Name then
  4630. return v
  4631. end
  4632. end
  4633. return nil
  4634. end
  4635.  
  4636. ----------------------------------------------------------------------
  4637. --------------------[ IGNORE MODEL HANDLING ]-------------------------
  4638. ----------------------------------------------------------------------
  4639.  
  4640. wait(math.random(0, 20) / 40) --This is to prevent more than one ignoreModel from being created
  4641.  
  4642. if _G.ignoreCode then --If the ignoreCode already exists, then the script creates the ignoreModel
  4643. --[[
  4644. The purpose of this is so that every gun in a game that uses this gun kit will share one ignoreModel. That way,
  4645. bullet trails, bullet holes, and other fake arms will be ignored by the gun which makes the bullets more likely to
  4646. hit a character part
  4647. --]]
  4648. if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
  4649. local ignoreModel = Instance.new("Model")
  4650. ignoreModel.Name = "ignoreModel_".._G.ignoreCode
  4651. ignoreModel.Parent = game.Workspace
  4652.  
  4653. local grenadeFolder = Instance.new("Model")
  4654. grenadeFolder.Name = "grenadeFolder"
  4655. grenadeFolder.Parent = ignoreModel
  4656.  
  4657. spawn(function()
  4658. while true do
  4659. ignoreModel.Parent = game.Workspace
  4660. grenadeFolder.Parent = ignoreModel
  4661. wait(1 / 20)
  4662. end
  4663. end)
  4664. end
  4665.  
  4666. script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
  4667. else
  4668. --[[
  4669. If there isn't already an ignoreCode, then this creates one. The purpose of it being random is so that if there is
  4670. an ignoreModel for something else in the game, the script won't end up placing the ignored objects in that ignoreModel
  4671. --]]
  4672. _G.ignoreCode = math.random(1, 1e4)
  4673.  
  4674. if (not game.Workspace:FindFirstChild("ignoreModel_".._G.ignoreCode)) then
  4675. local ignoreModel = Instance.new("Model")
  4676. ignoreModel.Name = "ignoreModel_".._G.ignoreCode
  4677. ignoreModel.Parent = game.Workspace
  4678.  
  4679. local grenadeFolder = Instance.new("Model")
  4680. grenadeFolder.Name = "grenadeFolder"
  4681. grenadeFolder.Parent = ignoreModel
  4682.  
  4683. spawn(function()
  4684. while true do
  4685. ignoreModel.Parent = game.Workspace
  4686. grenadeFolder.Parent = ignoreModel
  4687. wait(1 / 20)
  4688. end
  4689. end)
  4690. end
  4691.  
  4692. script.Parent:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value = _G.ignoreCode
  4693. end
  4694.  
  4695. spawn(function()
  4696. --[[
  4697. This function deletes any Player Folders that were left in the ignoreModel because the player left the game without
  4698. deselecting the Gun first
  4699. --]]
  4700. repeat wait() until _G.ignoreCode
  4701. local ignoreModel = game.Workspace:WaitForChild("ignoreModel_".._G.ignoreCode)
  4702. while true do
  4703. for _, gunIgnore in pairs(ignoreModel:GetChildren()) do
  4704. if gunIgnore.Name ~= "grenadeFolder" then
  4705. if (not game.Players:FindFirstChild(gunIgnore.Name:sub(11))) then
  4706. gunIgnore:Destroy()
  4707. end
  4708. end
  4709. end
  4710. wait(1 / 20)
  4711. end
  4712. end)
  4713.  
  4714. ----------------------------------------------------------------------
  4715. --------------------[ RESET CAMERA ]----------------------------------
  4716. ----------------------------------------------------------------------
  4717.  
  4718. Gun.ChildRemoved:connect(function(Child)
  4719. if Child == Handle and Plyr.Value then
  4720. local ignoreCode = Gun:WaitForChild("clientMain"):WaitForChild("ignoreCode").Value
  4721. local resetCam = script:WaitForChild("resetCam")
  4722. resetCam:WaitForChild("ignoreCode").Value = ignoreCode
  4723. resetCam.Parent = Plyr.Value.PlayerGui
  4724. end
  4725. end)
  4726.  
  4727. ----------------------------------------------------------------------
  4728. --------------------[ GET WELD CFRAMES ]------------------------------
  4729. ----------------------------------------------------------------------
  4730.  
  4731. for _, v in pairs(Gun:GetChildren()) do
  4732. if v:IsA("BasePart") and v ~= Handle then
  4733. if v:FindFirstChild("mainWeld") then v.mainWeld:Destroy() end
  4734. if (not v:FindFirstChild("weldCF")) then
  4735. local weldCF = Instance.new("CFrameValue")
  4736. weldCF.Name = "weldCF"
  4737. weldCF.Value = Handle.CFrame:toObjectSpace(v.CFrame)
  4738. weldCF.Parent = v
  4739. end
  4740. if string.sub(v.Name, 1, 3) == "Mag" then
  4741. if (not v:FindFirstChild("magTrans")) then
  4742. local magTrans = Instance.new("NumberValue")
  4743. magTrans.Name = "magTrans"
  4744. magTrans.Value = v.Transparency
  4745. magTrans.Parent = v
  4746. end
  4747. end
  4748. v.Anchored = true
  4749. v.CanCollide = false
  4750. end
  4751. end
  4752. Handle.Anchored = false
  4753. Handle.CanCollide = true
  4754.  
  4755. ----------------------------------------------------------------------
  4756. --------------------[ GUNSETUP HANDLING ]-----------------------------
  4757. ----------------------------------------------------------------------
  4758.  
  4759. local gunSetup = script:WaitForChild("gunSetup")
  4760. function gunSetup.OnServerInvoke(Player, Vars)
  4761.  
  4762. --------------------[ CREATING IGNORE MODELS ]--------------------------------
  4763.  
  4764. local gunIgnore = Instance.new("Model")
  4765. gunIgnore.Name = "gunIgnore_"..Player.Name
  4766. gunIgnore.Parent = Vars.ignoreModel
  4767.  
  4768. --------------------[ MODIFYING THE PLAYER ]----------------------------------
  4769.  
  4770. Vars.Humanoid.AutoRotate = false
  4771.  
  4772. Vars.Shoulders.Right.Part1 = nil
  4773. Vars.Shoulders.Left.Part1 = nil
  4774.  
  4775. local playerFolder = Instance.new("Model")
  4776. playerFolder.Name = "playerFolder"
  4777. playerFolder.Parent = gunIgnore
  4778.  
  4779. local headBase = Instance.new("Part")
  4780. headBase.Transparency = 1
  4781. headBase.Name = "headBase"
  4782. headBase.CanCollide = false
  4783. headBase.FormFactor = Enum.FormFactor.Custom
  4784. headBase.Size = V3(0.2, 0.2, 0.2)
  4785. headBase.BottomSurface = Enum.SurfaceType.Smooth
  4786. headBase.TopSurface = Enum.SurfaceType.Smooth
  4787. headBase.Parent = playerFolder
  4788.  
  4789. local headWeld = Instance.new("Weld")
  4790. headWeld.Part0 = Vars.Torso
  4791. headWeld.Part1 = headBase
  4792. headWeld.C0 = CF(0, 1.5, 0)
  4793. headWeld.Parent = Vars.Torso
  4794.  
  4795. local headWeld2 = Instance.new("Weld")
  4796. headWeld2.Part0 = headBase
  4797. headWeld2.Part1 = Vars.Head
  4798. headWeld2.Parent = headBase
  4799.  
  4800. local animBase = Instance.new("Part")
  4801. animBase.Transparency = 1
  4802. animBase.Name = "animBase"
  4803. animBase.CanCollide = false
  4804. animBase.FormFactor = Enum.FormFactor.Custom
  4805. animBase.Size = V3(0.2, 0.2, 0.2)
  4806. animBase.BottomSurface = Enum.SurfaceType.Smooth
  4807. animBase.TopSurface = Enum.SurfaceType.Smooth
  4808. animBase.Parent = playerFolder
  4809.  
  4810. local animWeld = Instance.new("Weld")
  4811. animWeld.Part0 = animBase
  4812. animWeld.Part1 = headBase
  4813. animWeld.Parent = animBase
  4814.  
  4815. local armBase = Instance.new("Part")
  4816. armBase.Transparency = 1
  4817. armBase.Name = "ArmBase"
  4818. armBase.CanCollide = false
  4819. armBase.FormFactor = Enum.FormFactor.Custom
  4820. armBase.Size = V3(0.2, 0.2, 0.2)
  4821. armBase.BottomSurface = Enum.SurfaceType.Smooth
  4822. armBase.TopSurface = Enum.SurfaceType.Smooth
  4823. armBase.Parent = playerFolder
  4824.  
  4825. local ABWeld = Instance.new("Weld")
  4826. ABWeld.Part0 = armBase
  4827. ABWeld.Part1 = animBase
  4828. ABWeld.Parent = armBase
  4829.  
  4830. local LArmBase = Instance.new("Part")
  4831. LArmBase.Transparency = 1
  4832. LArmBase.Name = "LArmBase"
  4833. LArmBase.CanCollide = false
  4834. LArmBase.FormFactor = Enum.FormFactor.Custom
  4835. LArmBase.Size = V3(0.2, 0.2, 0.2)
  4836. LArmBase.BottomSurface = Enum.SurfaceType.Smooth
  4837. LArmBase.TopSurface = Enum.SurfaceType.Smooth
  4838. LArmBase.Parent = playerFolder
  4839.  
  4840. local RArmBase = Instance.new("Part")
  4841. RArmBase.Transparency = 1
  4842. RArmBase.Name = "RArmBase"
  4843. RArmBase.CanCollide = false
  4844. RArmBase.FormFactor = Enum.FormFactor.Custom
  4845. RArmBase.Size = V3(0.2, 0.2, 0.2)
  4846. RArmBase.BottomSurface = Enum.SurfaceType.Smooth
  4847. RArmBase.TopSurface = Enum.SurfaceType.Smooth
  4848. RArmBase.Parent = playerFolder
  4849.  
  4850. local LWeld = Instance.new("Weld")
  4851. LWeld.Name = "LWeld"
  4852. LWeld.Part0 = armBase
  4853. LWeld.Part1 = LArmBase
  4854. LWeld.C0 = Vars.armC0[1]
  4855. LWeld.C1 = Vars.leftArmC1
  4856. LWeld.Parent = armBase
  4857.  
  4858. local RWeld = Instance.new("Weld")
  4859. RWeld.Name = "RWeld"
  4860. RWeld.Part0 = armBase
  4861. RWeld.Part1 = RArmBase
  4862. RWeld.C0 = Vars.armC0[2]
  4863. RWeld.C1 = Vars.rightArmC1
  4864. RWeld.Parent = armBase
  4865.  
  4866. local LWeld2 = Instance.new("Weld")
  4867. LWeld2.Name = "LWeld"
  4868. LWeld2.Part0 = LArmBase
  4869. LWeld2.Part1 = Vars.LArm
  4870. LWeld2.Parent = LArmBase
  4871.  
  4872. local RWeld2 = Instance.new("Weld")
  4873. RWeld2.Name = "RWeld"
  4874. RWeld2.Part0 = RArmBase
  4875. RWeld2.Part1 = Vars.RArm
  4876. RWeld2.Parent = RArmBase
  4877.  
  4878. local LLegWeld = Instance.new("Weld")
  4879. LLegWeld.Name = "LLegWeld"
  4880. LLegWeld.Part0 = Vars.Torso
  4881. LLegWeld.Part1 = nil
  4882. LLegWeld.C0 = CF(-0.5, -2, 0)
  4883. LLegWeld.Parent = Vars.Torso
  4884.  
  4885. local RLegWeld = Instance.new("Weld")
  4886. RLegWeld.Name = "RLegWeld"
  4887. RLegWeld.Part0 = Vars.Torso
  4888. RLegWeld.Part1 = nil
  4889. RLegWeld.C0 = CF(0.5, -2, 0)
  4890. RLegWeld.Parent = Vars.Torso
  4891.  
  4892. for _, Tab in pairs(Vars.gunParts) do
  4893. Tab.Obj.Anchored = false
  4894. local Weld = Instance.new("Weld")
  4895. Weld.Name = "mainWeld"
  4896. Weld.Part0 = Vars.Handle
  4897. Weld.Part1 = Tab.Obj
  4898. Weld.C0 = Tab.Obj.weldCF.Value
  4899. Weld.Parent = Vars.Handle
  4900. Tab.Weld = Weld
  4901. end
  4902.  
  4903. return gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, Vars.gunParts
  4904. end
  4905.  
  4906. ----------------------------------------------------------------------
  4907. --------------------[ TWEENJOINT HANDLING ]---------------------------
  4908. ----------------------------------------------------------------------
  4909.  
  4910. local createTweenIndicator = script:WaitForChild("createTweenIndicator")
  4911. function createTweenIndicator.OnServerInvoke(_, Joint, newCode)
  4912. local tweenIndicator = nil
  4913. if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
  4914. tweenIndicator = Instance.new("IntValue")
  4915. tweenIndicator.Name = "tweenCode"
  4916. tweenIndicator.Value = newCode
  4917. tweenIndicator.Parent = Joint
  4918. else
  4919. tweenIndicator = Joint.tweenCode
  4920. tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
  4921. end
  4922. return tweenIndicator
  4923. end
  4924.  
  4925. local lerpCF = script:WaitForChild("lerpCF")
  4926. function lerpCF.OnServerInvoke(_, Joint, Prop, startCF, endCF, Alpha)
  4927. spawn(function()
  4928. Joint[Prop] = startCF:lerp(endCF, Alpha)
  4929. end)
  4930. end
  4931.  
  4932. local deleteTweenIndicator = script:WaitForChild("deleteTweenIndicator")
  4933. function deleteTweenIndicator.OnServerInvoke(_, tweenIndicator, newCode)
  4934. if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
  4935. tweenIndicator:Destroy()
  4936. end
  4937. end
  4938.  
  4939. ----------------------------------------------------------------------
  4940. --------------------[ BULLET IMPACT HANDLING ]------------------------
  4941. ----------------------------------------------------------------------
  4942.  
  4943. local createBulletImpact = script:WaitForChild("createBulletImpact")
  4944. createBulletImpact.OnServerEvent:connect(function(_, H, P, N, D, humanoidFound, gunIgnore, S)
  4945. local surfaceCF = CF(P, P + N)
  4946. ----------------------------------------------------------------------------------
  4947. --Creating the bullet hole--------------------------------------------------------
  4948. ----------------------------------------------------------------------------------
  4949. if S.bulletHoles and (not humanoidFound) then
  4950. local Hole = Instance.new("Part")
  4951. Hole.Transparency = 1
  4952. Hole.Anchored = true
  4953. Hole.CanCollide = false
  4954. Hole.FormFactor = "Custom"
  4955. Hole.Size = V3(1, 1, 0.2)
  4956. Hole.TopSurface = 0
  4957. Hole.BottomSurface = 0
  4958. local Mesh = Instance.new("BlockMesh")
  4959. Mesh.Offset = V3(0, 0, -0.05)
  4960. Mesh.Scale = V3(S.holeSettings.Size, S.holeSettings.Size, 0)
  4961. Mesh.Parent = Hole
  4962. local Decal = Instance.new("Decal")
  4963. Decal.Face = Enum.NormalId.Front
  4964. Decal.Texture = S.holeSettings.Texture
  4965. Decal.Parent = Hole
  4966. Hole.Parent = gunIgnore
  4967. Hole.CFrame = surfaceCF
  4968. if (not H.Anchored) then
  4969. local Weld = Instance.new("Weld", Hole)
  4970. Weld.Part0 = H
  4971. Weld.Part1 = Hole
  4972. Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
  4973. Hole.Anchored = false
  4974. end
  4975. delay(S.holeSettings.visibleTime, function()
  4976. if S.holeSettings.disappearTime > 0 then
  4977. local t0 = tick()
  4978. while true do
  4979. local Alpha = math.min((tick() - t0) / S.holeSettings.disappearTime, 1)
  4980. Decal.Transparency = numLerp(0, 1, Alpha)
  4981. if Alpha == 1 then break end
  4982. wait()
  4983. end
  4984. Hole:Destroy()
  4985. else
  4986. Hole:Destroy()
  4987. end
  4988. end)
  4989. end
  4990. ----------------------------------------------------------------------------------
  4991. --Creating the spark effect-------------------------------------------------------
  4992. ----------------------------------------------------------------------------------
  4993. if S.bulletSparks and (not humanoidFound) and inList(H.Material, S.sparkSettings.Materials) then
  4994. local Sparks = Instance.new("Part")
  4995. Sparks.Transparency = 1
  4996. Sparks.Anchored = true
  4997. Sparks.CanCollide = false
  4998. Sparks.FormFactor = "Custom"
  4999. Sparks.Size = V3(1, 1, 1)
  5000. Sparks.TopSurface = 0
  5001. Sparks.BottomSurface = 0
  5002.  
  5003. local Particles = nil
  5004. if S.customSparks then
  5005. Particles = getObject(game.ServerStorage, "ParticleEmitter", "bulletSpark"):Clone()
  5006. else
  5007. Particles = Instance.new("ParticleEmitter")
  5008. Particles.Color = ColorSequence.new(S.sparkSettings.Color.Start, S.sparkSettings.Color.End)
  5009. Particles.LightEmission = 1
  5010. Particles.Size = NumberSequence.new(
  5011. {
  5012. NumberSequenceKeypoint.new(0, S.sparkSettings.Size, 0.25);
  5013. NumberSequenceKeypoint.new(1, 0);
  5014. }
  5015. )
  5016. Particles.Texture = S.sparkSettings.Texture
  5017. Particles.Transparency = NumberSequence.new(0)
  5018. Particles.Acceleration = V3(0, -196.2, 0)
  5019. Particles.EmissionDirection = Enum.NormalId.Front
  5020. Particles.Lifetime = NumberRange.new(S.sparkSettings.Lifetime - 0.05, S.sparkSettings.Lifetime + 0.05)
  5021. Particles.Rate = S.sparkSettings.Rate
  5022. Particles.Rotation = NumberRange.new(0, 360)
  5023. Particles.Speed = NumberRange.new(S.sparkSettings.Speed - 5, S.sparkSettings.Speed + 5)
  5024. Particles.VelocitySpread = S.sparkSettings.Spread
  5025. end
  5026. Particles.Parent = Sparks
  5027.  
  5028. Sparks.Parent = gunIgnore
  5029. Sparks.CFrame = surfaceCF
  5030. if (not H.Anchored) then
  5031. local Weld = Instance.new("Weld", Sparks)
  5032. Weld.Part0 = H
  5033. Weld.Part1 = Sparks
  5034. Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
  5035. Sparks.Anchored = false
  5036. end
  5037. delay(0.1, function()
  5038. Particles.Enabled = false
  5039. wait(Particles.Lifetime.Max)
  5040. Sparks:Destroy()
  5041. end)
  5042. end
  5043. ----------------------------------------------------------------------------------
  5044. --Creating the smoke effect-------------------------------------------------------
  5045. ----------------------------------------------------------------------------------
  5046. if S.bulletSmoke and (not humanoidFound) then
  5047. local Smoke = Instance.new("Part")
  5048. Smoke.Transparency = 1
  5049. Smoke.Anchored = true
  5050. Smoke.CanCollide = false
  5051. Smoke.FormFactor = "Custom"
  5052. Smoke.Size = V3(1, 1, 1)
  5053. Smoke.TopSurface = 0
  5054. Smoke.BottomSurface = 0
  5055.  
  5056. local Particles = Instance.new("ParticleEmitter")
  5057. Particles.Color = ColorSequence.new(S.smokeSettings.objColor and H.Color or S.smokeSettings.Color)
  5058. Particles.LightEmission = 0
  5059. Particles.Size = NumberSequence.new(
  5060. {
  5061. NumberSequenceKeypoint.new(0, S.smokeSettings.Size.Start);
  5062. NumberSequenceKeypoint.new(1, S.smokeSettings.Size.End);
  5063. }
  5064. )
  5065. Particles.Texture = S.smokeSettings.Texture
  5066. Particles.Transparency = NumberSequence.new(
  5067. {
  5068. NumberSequenceKeypoint.new(0, S.smokeSettings.startTransparency);
  5069. NumberSequenceKeypoint.new(0.5, 0.75 * S.smokeSettings.startTransparency + 0.25);
  5070. NumberSequenceKeypoint.new(1, 1);
  5071. }
  5072. )
  5073. Particles.Acceleration = V3(0, -196.2, 0)
  5074. Particles.EmissionDirection = Enum.NormalId.Front
  5075. Particles.Lifetime = NumberRange.new(S.smokeSettings.Lifetime - 0.05, S.smokeSettings.Lifetime + 0.05)
  5076. Particles.Rate = S.smokeSettings.Rate
  5077. Particles.Rotation = NumberRange.new(0, 360)
  5078. Particles.RotSpeed = NumberRange.new(10)
  5079. Particles.Speed = NumberRange.new(S.smokeSettings.Speed - 5, S.smokeSettings.Speed + 5)
  5080. Particles.VelocitySpread = S.smokeSettings.Spread
  5081. Particles.Parent = Smoke
  5082.  
  5083. Smoke.Parent = gunIgnore
  5084. Smoke.CFrame = surfaceCF
  5085. if (not H.Anchored) then
  5086. local Weld = Instance.new("Weld", Smoke)
  5087. Weld.Part0 = H
  5088. Weld.Part1 = Smoke
  5089. Weld.C0 = H.CFrame:toObjectSpace(surfaceCF)
  5090. Smoke.Anchored = false
  5091. end
  5092. delay(0.1, function()
  5093. Particles.Enabled = false
  5094. wait(S.smokeSettings.Lifetime + 0.05)
  5095. Smoke:Destroy()
  5096. end)
  5097. end
  5098. end)
  5099.  
  5100. ----------------------------------------------------------------------
  5101. --------------------[ SHOCKWAVE HANDLING ]----------------------------
  5102. ----------------------------------------------------------------------
  5103.  
  5104. local createShockwave = script:WaitForChild("createShockwave")
  5105. createShockwave.OnServerEvent:connect(function(_, Center, Radius, gunIgnore, S)
  5106. local Shockwave = Instance.new("Part")
  5107. Shockwave.BrickColor = S.shockwaveSettings.Color
  5108. Shockwave.Material = Enum.Material.SmoothPlastic
  5109. Shockwave.Name = "Shockwave"
  5110. Shockwave.Anchored = true
  5111. Shockwave.CanCollide = false
  5112. Shockwave.FormFactor = Enum.FormFactor.Symmetric
  5113. Shockwave.Size = V3(1, 1, 1)
  5114. Shockwave.BottomSurface = Enum.SurfaceType.Smooth
  5115. Shockwave.TopSurface = Enum.SurfaceType.Smooth
  5116. local Mesh = Instance.new("SpecialMesh")
  5117. Mesh.MeshType = Enum.MeshType.Sphere
  5118. Mesh.Scale = V3()
  5119. Mesh.Parent = Shockwave
  5120. Shockwave.Parent = gunIgnore
  5121. Shockwave.CFrame = CF(Center)
  5122. spawn(function()
  5123. local t0 = tick()
  5124. while true do
  5125. local Alpha = math.min((tick() - t0) / S.shockwaveSettings.Duration, 1)
  5126. local Scale = 2 * Radius * Alpha
  5127. Mesh.Scale = V3(Scale, Scale, Scale)
  5128. Shockwave.Transparency = Alpha
  5129. if Alpha == 1 then break end
  5130. wait()
  5131. end
  5132. Shockwave:Destroy()
  5133. end)
  5134. end)
  5135.  
  5136. ----------------------------------------------------------------------
  5137. --------------------[ BLOOD HANDLING ]--------------------------------
  5138. ----------------------------------------------------------------------
  5139.  
  5140. local createBlood = script:WaitForChild("createBlood")
  5141. createBlood.OnServerEvent:connect(function(_, H, P, D, gunIgnore, S)
  5142. local bloodCF = CF(P, P + D) * CFANG(RAD(-90), 0, 0)
  5143. local Blood = Instance.new("Part")
  5144. Blood.Transparency = 1
  5145. Blood.Anchored = true
  5146. Blood.CanCollide = false
  5147. Blood.FormFactor = "Custom"
  5148. Blood.Size = V3(0.2, 1, 0.2)
  5149. Blood.TopSurface = 0
  5150. Blood.BottomSurface = 0
  5151.  
  5152. local Particles = Instance.new("ParticleEmitter")
  5153. Particles.Color = ColorSequence.new(S.bloodSettings.Color)
  5154. Particles.LightEmission = 0
  5155. Particles.Size = NumberSequence.new(S.bloodSettings.Size)
  5156. Particles.Texture = S.bloodSettings.Texture
  5157. Particles.Transparency = NumberSequence.new(
  5158. {
  5159. NumberSequenceKeypoint.new(0, S.bloodSettings.startTransparency);
  5160. NumberSequenceKeypoint.new(1, 1);
  5161. }
  5162. )
  5163. Particles.EmissionDirection = Enum.NormalId.Top
  5164. Particles.Lifetime = NumberRange.new(S.bloodSettings.Lifetime - 0.05, S.bloodSettings.Lifetime + 0.05)
  5165. Particles.Rate = S.bloodSettings.Rate
  5166. Particles.Rotation = NumberRange.new(0, 90)
  5167. Particles.Speed = NumberRange.new(S.bloodSettings.Speed)
  5168. Particles.VelocitySpread = S.bloodSettings.Spread
  5169. Particles.Parent = Blood
  5170.  
  5171. Blood.Parent = gunIgnore
  5172. Blood.CFrame = bloodCF
  5173. if (not H.Anchored) then
  5174. local Weld = Instance.new("Weld", Blood)
  5175. Weld.Part0 = H
  5176. Weld.Part1 = Blood
  5177. Weld.C0 = H.CFrame:toObjectSpace(bloodCF)
  5178. Blood.Anchored = false
  5179. end
  5180. delay(0.15, function()
  5181. Particles.Enabled = false
  5182. wait(S.bloodSettings.Lifetime + 0.05)
  5183. Blood:Destroy()
  5184. end)
  5185. end)
  5186.  
  5187. ----------------------------------------------------------------------
  5188. --------------------[ TRAIL HANDLING ]--------------------------------
  5189. ----------------------------------------------------------------------
  5190.  
  5191. local createTrail = script:WaitForChild("createTrail")
  5192. createTrail.OnServerEvent:connect(function(_, Origin, P, gunIgnore, S)
  5193. local Trail = Instance.new("Part")
  5194. Trail.BrickColor = S.trailSettings.Color
  5195. Trail.Transparency = S.trailSettings.Transparency
  5196. Trail.Anchored = true
  5197. Trail.CanCollide = false
  5198. Trail.Size = V3(1, 1, 1)
  5199. local Mesh = Instance.new("CylinderMesh")
  5200. Mesh.Offset = V3(0, -(P - Origin).magnitude / 2, 0)
  5201. Mesh.Scale = V3(S.trailSettings.Thickness, (P - Origin).magnitude, S.trailSettings.Thickness)
  5202. Mesh.Parent = Trail
  5203. Trail.Parent = gunIgnore
  5204. Trail.CFrame = CF(Origin, P) * CFANG(RAD(90), 0, 0)
  5205. delay(S.trailSettings.visibleTime, function()
  5206. if S.trailSettings.disappearTime > 0 then
  5207. local t0 = tick()
  5208. while true do
  5209. local Alpha = math.min((tick() - t0) / S.trailSettings.disappearTime, 1)
  5210. Trail.Transparency = numLerp(S.trailSettings.Transparency, 1, Alpha)
  5211. if Alpha == 1 then break end
  5212. wait()
  5213. end
  5214. Trail:Destroy()
  5215. else
  5216. Trail:Destroy()
  5217. end
  5218. end)
  5219. end)
  5220. end))
  5221. ObjectValue98.Name = "Plyr"
  5222. ObjectValue98.Parent = Script97
  5223. RemoteFunction99.Name = "getWeldCF"
  5224. RemoteFunction99.Parent = Script97
  5225. RemoteFunction100.Name = "gunSetup"
  5226. RemoteFunction100.Parent = Script97
  5227. RemoteFunction101.Name = "tweenJoint"
  5228. RemoteFunction101.Parent = Script97
  5229. RemoteEvent102.Name = "onRenderStep"
  5230. RemoteEvent102.Parent = Script97
  5231. RemoteFunction103.Name = "createTweenIndicator"
  5232. RemoteFunction103.Parent = Script97
  5233. RemoteFunction104.Name = "deleteTweenIndicator"
  5234. RemoteFunction104.Parent = Script97
  5235. RemoteFunction105.Name = "lerpCF"
  5236. RemoteFunction105.Parent = Script97
  5237. LocalScript106.Name = "resetCam"
  5238. LocalScript106.Parent = Script97
  5239. table.insert(cors,sandbox(LocalScript106,function()
  5240. repeat wait() until game.Players.LocalPlayer.Character
  5241.  
  5242. local Player = game.Players.LocalPlayer
  5243. local Char = Player.Character
  5244. local Humanoid = Char:WaitForChild("Humanoid")
  5245.  
  5246. local Cam = game.Workspace.CurrentCamera
  5247. local UIS = game:GetService("UserInputService")
  5248.  
  5249. local ignoreCode = script:WaitForChild("ignoreCode")
  5250. repeat wait() until ignoreCode.Value ~= 0
  5251. local ignoreModel = game.Workspace:WaitForChild("ignoreModel_"..ignoreCode.Value)
  5252. local gunIgnore = ignoreModel:FindFirstChild("gunIgnore_"..Player.Name)
  5253.  
  5254. Cam.FieldOfView = 70
  5255. Cam.CameraType = Enum.CameraType.Custom
  5256. Cam:ClearAllChildren()
  5257.  
  5258. UIS.MouseBehavior = Enum.MouseBehavior.Default
  5259. UIS.MouseIconEnabled = true
  5260.  
  5261. Player.CameraMode = Enum.CameraMode.Classic
  5262.  
  5263. Humanoid.WalkSpeed = 16
  5264. Humanoid.AutoRotate = true
  5265.  
  5266. if gunIgnore then gunIgnore:Destroy() end
  5267. end))
  5268. IntValue107.Name = "ignoreCode"
  5269. IntValue107.Parent = LocalScript106
  5270. RemoteEvent108.Name = "createBulletImpact"
  5271. RemoteEvent108.Parent = Script97
  5272. RemoteEvent109.Name = "createShockwave"
  5273. RemoteEvent109.Parent = Script97
  5274. RemoteEvent110.Name = "createBlood"
  5275. RemoteEvent110.Parent = Script97
  5276. RemoteEvent111.Name = "createTrail"
  5277. RemoteEvent111.Parent = Script97
  5278. ManualWeld112.Name = "BoltBack-to-BoltBack Strong Joint"
  5279. ManualWeld112.Parent = mas
  5280. ManualWeld112.C0 = CFrame.new(0.625068724, -0.405017436, 0.405023932, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  5281. ManualWeld112.C1 = CFrame.new(0.405136883, 0.00964355469, 0.405289888, 8.75407204e-06, -1.00000083, 4.18243417e-07, -1.9739764e-06, 4.16348257e-07, 1.00000513, -1.00000739, -1.20323393e-05, -1.9724248e-06)
  5282. ManualWeld112.Part0 = nil
  5283. ManualWeld112.Part1 = nil
  5284. ManualWeld113.Name = "BoltBack-to-Bolt Strong Joint"
  5285. ManualWeld113.Parent = mas
  5286. ManualWeld113.C0 = CFrame.new(0.625068724, -0.405017436, 0.405023932, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  5287. ManualWeld113.C1 = CFrame.new(0.40513739, 0.00952148438, 0.405278921, 1.44540654e-05, -1, 8.52680785e-07, -7.99414829e-06, 8.52565222e-07, 1, -1, -1.44540718e-05, -7.99413556e-06)
  5288. ManualWeld113.Part0 = nil
  5289. ManualWeld113.Part1 = nil
  5290. ManualWeld114.Name = "Grip-to-Mag Strong Joint"
  5291. ManualWeld114.Parent = mas
  5292. ManualWeld114.C0 = CFrame.new(0.0500016622, -0.325031132, 0.325033486, 1, 0, 0, 0, 0, -1, 0, 1, 0)
  5293. ManualWeld114.C1 = CFrame.new(0.155040443, -0.244984984, -0.225891113, -0.999999166, -1.16036881e-06, -3.29050204e-06, -8.68707048e-07, 1.38209816e-05, 0.999997616, -1.0148425e-06, 0.999999404, -1.95805678e-05)
  5294. ManualWeld114.Part0 = nil
  5295. ManualWeld114.Part1 = nil
  5296. ManualWeld115.Name = "Grip-to-Mag Strong Joint"
  5297. ManualWeld115.Parent = mas
  5298. ManualWeld115.C0 = CFrame.new(0.0500016622, -0.325031132, 0.325033486, 1, 0, 0, 0, 0, -1, 0, 1, 0)
  5299. ManualWeld115.C1 = CFrame.new(-0.254957616, -0.244977713, -0.225891113, -1, -8.6936484e-07, 1.56242345e-06, 1.56241674e-06, 7.93099662e-06, 1, -8.69377232e-07, 1, -7.93099571e-06)
  5300. ManualWeld115.Part0 = nil
  5301. ManualWeld115.Part1 = nil
  5302. ManualWeld116.Name = "Misc-to-Misc Strong Joint"
  5303. ManualWeld116.Parent = mas
  5304. ManualWeld116.C0 = CFrame.new(0.450001687, -0.0500037596, 0.450001001, 0.99999994, 0, 0, 0, 0, -0.99999994, -0, 1, 0)
  5305. ManualWeld116.C1 = CFrame.new(-0.449884027, 0.00927734375, -0.44998008, -1, -6.49860067e-06, 8.75691403e-05, -8.75705809e-05, 0.000222719216, -1, 6.47909701e-06, -1, -0.000222719784)
  5306. ManualWeld116.Part0 = nil
  5307. ManualWeld116.Part1 = nil
  5308. Part117.Name = "AimPart"
  5309. Part117.Parent = Tool0
  5310. Part117.BrickColor = BrickColor.new("Really black")
  5311. Part117.Reflectance = 0.10000000149012
  5312. Part117.Transparency = 1
  5313. Part117.FormFactor = Enum.FormFactor.Plate
  5314. Part117.Size = Vector3.new(0.25, 0.300000012, 0.300000012)
  5315. Part117.CFrame = CFrame.new(-0.75, 1.82500005, -1023, 0.999999166, -8.22455877e-06, 1.59695787e-07, 5.80272945e-06, 0.999997616, 6.04837842e-05, -3.0570294e-07, -6.62434541e-05, 0.999999404)
  5316. Part117.BottomSurface = Enum.SurfaceType.Smooth
  5317. Part117.TopSurface = Enum.SurfaceType.Smooth
  5318. Part117.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  5319. Part117.Position = Vector3.new(-0.75, 1.82500005, -1023)
  5320. Part117.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  5321. Weld118.Parent = Part117
  5322. Weld118.C0 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5323. Weld118.C1 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5324. Weld118.Part0 = Part117
  5325. Weld118.Part1 = Part117
  5326. Weld119.Parent = Part117
  5327. Weld119.C0 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5328. Weld119.C1 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5329. Weld119.Part0 = Part117
  5330. Weld119.Part1 = Part117
  5331. Weld120.Parent = Part117
  5332. Weld120.C0 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5333. Weld120.C1 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5334. Weld120.Part0 = Part117
  5335. Weld120.Part1 = Part117
  5336. BlockMesh121.Parent = Part117
  5337. BlockMesh121.Scale = Vector3.new(0.0500000007, 0.650000036, 0.300000012)
  5338. BlockMesh121.Scale = Vector3.new(0.0500000007, 0.650000036, 0.300000012)
  5339. ManualWeld122.Name = "Misc-to-Misc Strong Joint"
  5340. ManualWeld122.Parent = mas
  5341. ManualWeld122.C0 = CFrame.new(-0.450000018, -0.25000006, 0.0500000007, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  5342. ManualWeld122.C1 = CFrame.new(-0.449859858, 0.0100097656, -0.250048518, 1, -5.81829481e-05, 0.000121089586, 0.000121068173, -0.000367745582, -1, 5.82274661e-05, 1, -0.000367738539)
  5343. ManualWeld122.Part0 = nil
  5344. ManualWeld122.Part1 = nil
  5345. Part123.Name = "Handle"
  5346. Part123.Parent = Tool0
  5347. Part123.Material = Enum.Material.Metal
  5348. Part123.BrickColor = BrickColor.new("Really black")
  5349. Part123.Reflectance = 0.10000000149012
  5350. Part123.FormFactor = Enum.FormFactor.Plate
  5351. Part123.Size = Vector3.new(1, 0.400000006, 1)
  5352. Part123.CFrame = CFrame.new(-0.0799999982, 1.14499998, -1023.70001, 0.999999166, -3.24303874e-05, -2.57747911e-06, 3.00083575e-05, 0.999997616, -6.64702238e-05, 2.43398608e-06, 6.07107067e-05, 0.999999404)
  5353. Part123.BottomSurface = Enum.SurfaceType.Smooth
  5354. Part123.TopSurface = Enum.SurfaceType.Smooth
  5355. Part123.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  5356. Part123.Position = Vector3.new(-0.0799999982, 1.14499998, -1023.70001)
  5357. Part123.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  5358. BlockMesh124.Parent = Part123
  5359. BlockMesh124.Scale = Vector3.new(0.0500000007, 0.650000036, 0.300000012)
  5360. BlockMesh124.Scale = Vector3.new(0.0500000007, 0.650000036, 0.300000012)
  5361. Sound125.Name = "FireSound"
  5362. Sound125.Parent = Part123
  5363. Sound125.SoundId = "rbxassetid://132456187"
  5364. Weld126.Parent = Part123
  5365. Weld126.C0 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5366. Weld126.C1 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5367. Weld126.Part0 = Part123
  5368. Weld126.Part1 = Part123
  5369. Weld127.Parent = Part123
  5370. Weld127.C0 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5371. Weld127.C1 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5372. Weld127.Part0 = Part123
  5373. Weld127.Part1 = Part123
  5374. Weld128.Parent = Part123
  5375. Weld128.C0 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5376. Weld128.C1 = CFrame.new(0, 0, 0, -0.573416114, -0.0331745297, 0.81859225, -0.0776699185, 0.99688077, -0.0140071288, -0.815574169, -0.0716118738, -0.574204147)
  5377. Weld128.Part0 = Part123
  5378. Weld128.Part1 = Part123
  5379. ManualWeld129.Name = "Bolt-to-BoltBack Strong Joint"
  5380. ManualWeld129.Parent = mas
  5381. ManualWeld129.C0 = CFrame.new(0.625068724, -0.405017436, 0.405023932, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  5382. ManualWeld129.C1 = CFrame.new(0.405138791, 0.00964355469, 0.405309081, 3.04465129e-06, -1, 5.59968214e-07, -7.86535111e-06, 5.59944283e-07, 1, -1, -3.04465584e-06, -7.86534929e-06)
  5383. ManualWeld129.Part0 = nil
  5384. ManualWeld129.Part1 = nil
  5385. ManualWeld130.Name = "Bolt-to-Bolt Strong Joint"
  5386. ManualWeld130.Parent = mas
  5387. ManualWeld130.C0 = CFrame.new(0.625068724, -0.405017436, 0.405023932, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  5388. ManualWeld130.C1 = CFrame.new(0.405144274, 0.00952148438, 0.405310631, -2.67400219e-06, -1, 1.28348017e-06, -2.56683252e-05, 1.28354884e-06, 1, -1, 2.67396877e-06, -2.56683288e-05)
  5389. ManualWeld130.Part0 = nil
  5390. ManualWeld130.Part1 = nil
  5391. IntValue131.Name = "Ammo"
  5392. IntValue131.Parent = Tool0
  5393. IntValue131.Value = 4
  5394. ManualWeld132.Name = "Grip2-to-Grip2 Strong Joint"
  5395. ManualWeld132.Parent = mas
  5396. ManualWeld132.C0 = CFrame.new(0.0500000045, -0.100000009, 0.0250000134, 1, 0, 0, 0, 0, -1, 0, 1, 0)
  5397. ManualWeld132.C1 = CFrame.new(0.049996756, 0.199924648, 0.0250244141, 1, -2.91017074e-07, -4.84369866e-06, -4.84369866e-06, -4.1427143e-11, -1, 2.91017074e-07, 1, -4.27464557e-11)
  5398. ManualWeld132.Part0 = nil
  5399. ManualWeld132.Part1 = nil
  5400. IntValue133.Name = "ClipSize"
  5401. IntValue133.Parent = Tool0
  5402. IntValue133.Value = 4
  5403. IntValue134.Name = "StoredAmmo"
  5404. IntValue134.Parent = Tool0
  5405. IntValue134.Value = 240
  5406. ManualWeld135.Name = "Misc-to-Misc Strong Joint"
  5407. ManualWeld135.Parent = mas
  5408. ManualWeld135.C0 = CFrame.new(-0.449999988, 0.0100080129, 0.4500359, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  5409. ManualWeld135.C1 = CFrame.new(0.45012334, 0.0100097656, -0.44995296, 1, -1.11122654e-05, -8.69558062e-05, 8.69580253e-05, 0.000199721748, 1, -1.10948977e-05, -1, 0.000199722708)
  5410. ManualWeld135.Part0 = nil
  5411. ManualWeld135.Part1 = nil
  5412. ManualWeld136.Name = "Body-to-Bolt Strong Joint"
  5413. ManualWeld136.Parent = mas
  5414. ManualWeld136.C0 = CFrame.new(-0.450001568, 2.17506409, 0.450050414, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  5415. ManualWeld136.C1 = CFrame.new(-0.625488281, 0.449997813, 0.45008862, -2.70885266e-07, 3.27823218e-05, 1.00000477, 1.00000024, -1.53244291e-05, 4.1487715e-07, 9.61506612e-06, 1.00000477, -2.68908843e-05)
  5416. ManualWeld136.Part0 = nil
  5417. ManualWeld136.Part1 = nil
  5418. for i,v in pairs(mas:GetChildren()) do
  5419. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  5420. pcall(function() v:MakeJoints() end)
  5421. end
  5422. mas:Destroy()
  5423. for i,v in pairs(cors) do
  5424. spawn(function()
  5425. pcall(v)
  5426. end)
  5427. end
Add Comment
Please, Sign In to add comment