ThePimpWhoPimps

Untitled

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