Advertisement
MrSlakyx

hygh

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