Vechol

TEST2

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