Advertisement
okban

Untitled

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