Advertisement
Bruno972

test does not work

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