Advertisement
PuffyDylan

Halo Assault Rifle

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