mattofm

Phatom forces new script

Sep 20th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.10 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local Input = game:GetService("UserInputService")
  3. local LocalPlayer = Players.LocalPlayer
  4. local Mouse = LocalPlayer:GetMouse()
  5. local Camera = workspace.CurrentCamera
  6. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  7.  
  8. local function GetWeaponTable()
  9. return ReplicatedStorage.GunModules:GetChildren()
  10. end
  11.  
  12. local function GetWeaponNames()
  13. local names = { }
  14.  
  15. for k, v in pairs(GetWeaponTable()) do
  16. names[tostring(v)] = tostring(v)
  17. end
  18.  
  19. return names
  20. end
  21.  
  22. local Type = {
  23. Number = 1,
  24. String = 2,
  25. Bool = 3,
  26. Angle = 4,
  27. CFrame = 5,
  28. Vector = 6,
  29. Enum = 7
  30. }
  31.  
  32. local CurrentGun = ""
  33. local CurrentGunTable = { }
  34.  
  35. local StatInfos = {
  36. name = { Name = "Name", Type = Type.String },
  37. --type = { Name = "Type", Type = Type.Enum, Enum = {"SNIPER", "DMR", "LMG", "PISTOL", "KNIFE", "ASSAULT", "REVOLVER", "SHOTGUN", "Grenade"} },
  38. description={ Name = "Description", Type = Type.String },
  39. zoom = { Name = "Zoom", Type = Type.Number, Min = 1, Max = 20 },
  40. magnifyspeed = { Name = "Zoom speed", Type = Type.Number, Min = 1, Max = 50 },
  41. firerate = { Name = "Firerate", Type = Type.Number, Min = 1, Max = 2000 },
  42. walkspeed = { Name = "Walk speed", Type = Type.Number, Min = 1, Max = 32 },
  43. sprintspeed={ Name = "Sprint speed", Type = Type.Number, Min = 1, Max = 32 },
  44. swayspeed = { Name = "Sway speed", Type = Type.Number, Min = 0, Max = 5},
  45. swayamp = { Name = "Sway amplifier", Type = Type.Number, Min = 0, Max = 50},
  46. firevolume ={ Name = "Fire sound volume", Type = Type.Number, Min = 0, Max = 5},
  47. firepitch = { Name = "Fire sound pitch", Type = Type.Number, Min = 0, Max = 5},
  48. suppression={ Name = "Suppression", Type = Type.Number, Min = 0, Max = 1},
  49. chamber = { Name = "Additional chamber bullet", Type = Type.Bool},
  50. magsize = { Name = "Magazine size", Type = Type.Number, Min = 1, Max = 360},
  51. sparerounds={ Name = "Spare rounds", Type = Type.Number, Min = 1, Max = 360},
  52. crosssize = { Name = "Crosshair size", Type = Type.Number, Min = 0, Max = 100},
  53. crossexpansion = { Name = "Crosshair expansion", Type = Type.Number, Min = 0, Max = 1000},
  54. crossspeed ={ Name = "Crosshair recover speed", Type = Type.Number, Min = 0, Max = 100},
  55. crossdamper={ Name = "Crosshair recover damper", Type = Type.Number, Min = 0, Max = 1},
  56. hipfirespread = { Name = "Hipfire spread", Type = Type.Number, Min = 0, Max = 1},
  57. hipfirestability = { Name = "Hipfire stability", Type = Type.Number, Min = 0, Max = 1},
  58. hipfirespreadrecover = { Name = "Hipfire spread recover", Type = Type.Number, Min = 1, Max = 100},
  59. camkickspeed = { Name = "Camera kick speed", Type = Type.Number, Min = 0, Max = 100},
  60. aimcamkickspeed = { Name = "Aim camera kick speed", Type = Type.Number, Min = 0, Max = 100},
  61. aimkickmult = { Name = "Aim camera kick multiplicator", Type = Type.Number, Min = 0, Max = 1},
  62. aimwalkspeedmult = { Name = "Aim camera walk speed multiplicator", Type = Type.Number, Min = 0, Max = 3},
  63. aimspeed = { Name = "Aim speed", Type = Type.Number, Min = 0, Max = 100},
  64. cameraspeed = { Name = "Camera speed", Type = Type.Number, Min = 0, Max = 100},
  65. modelkickspeed = { Name = "Model kick speed", Type = Type.Number, Min = 0, Max = 100},
  66. modelrecoverspeed = { Name = "Model kick recover speed", Type = Type.Number, Min = 0, Max = 100},
  67. modelkickdamper = { Name = "Model kick recover speed", Type = Type.Number, Min = 0, Max = 1},
  68. aimzdist = { Name = "Scope size", Type = Type.Number, Min = 0, Max = 10},
  69. bolttime = { Name = "Bolting time", Type = Type.Number, Min = 0, Max = 5},
  70. equipspeed ={ Name = "Equip speed", Type = Type.Number, Min = 0, Max = 100},
  71. rotkickmin ={ Name = "Minimum recoil rotation", Type = Type.Vector},
  72. rotkickmax ={ Name = "Maximum recoil rotation", Type = Type.Vector},
  73. transkickmin = { Name = "Minimum recoil displacement", Type = Type.Vector},
  74. transkickmax = { Name = "Maximum recoil displacement", Type = Type.Vector},
  75. camkickmin ={ Name = "Minimum camera kick", Type = Type.Vector},
  76. camkickmax ={ Name = "Maximum camera kick", Type = Type.Vector},
  77. aimrotkickmin = { Name = "Minimum aim recoil rotation", Type = Type.Vector},
  78. aimrotkickmax = { Name = "Maximum aim recoil rotation", Type = Type.Vector},
  79. aimtranskickmin = { Name = "Minimum aim recoil displacement", Type = Type.Vector},
  80. aimtranskickmax = { Name = "Maximum aim recoil displacement", Type = Type.Vector},
  81. aimcamkickmin = { Name = "Minimum aim camera kick", Type = Type.Vector},
  82. aimcamkickmax = { Name = "Maximum aim camera kick", Type = Type.Vector},
  83. }
  84.  
  85. getgenv().StatControls = { }
  86. local StatControls = getgenv().StatControls
  87.  
  88. function InitUI()
  89. local library = loadstring(game:HttpGet("https://pastebin.com/raw/qwdPKKDN"))()
  90. _G.ui = library.new("AOSHax Phantom Forces v0.2.8")
  91.  
  92. local AimbotPage = _G.ui:addPage("Aimbot", 2772096931)
  93. local ESPPage = _G.ui:addPage("ESP", 2772096931)
  94. local GunPage = _G.ui:addPage("Gun mods", 2772096931)
  95. local OtherPage = _G.ui:addPage("Other", 2772096931)
  96.  
  97. _G.gunsect = GunPage:addSection("Weapon mods")
  98. _G.gunsect:addDropdown("Weapon", GetWeaponNames(), function(text)
  99. spawn(function()
  100. CurrentGun = text
  101. CurrentGunTable = require(ReplicatedStorage.GunModules:FindFirstChild(text))
  102.  
  103. UpdateControls()
  104. end)
  105. end)
  106.  
  107. _G.AimbotSettings = { Enabled = false, FOV = 30, AimPart = "Head", Autofire = false, Smooth = 0 }
  108. local AimbotSettings = _G.AimbotSettings
  109.  
  110. local AimbotSection = AimbotPage:addSection("Aimbot")
  111. AimbotSection:addToggle("Enabled", AimbotSettings.Enabled, function(bool) AimbotSettings.Enabled = bool end)
  112. AimbotSection:addSlider("FOV", AimbotSettings.FOV, 0, 180, function(int) AimbotSettings.FOV = int end)
  113. AimbotSection:addSlider("Smoothing", AimbotSettings.Smooth, 0, 100, function(int) AimbotSettings.Smooth = int end)
  114. AimbotSection:addDropdown("Aim Bone", { "Head", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg" }, function(str) AimbotSettings.AimPart = str end)
  115. AimbotSection:addToggle("Autofire", AimbotSettings.Autofire, function(bool) AimbotSettings.Autofire = bool end)
  116.  
  117. _G.KnifeAuraSettings = { Enabled = false, Distance = 25, Cooldown = 0, ForceBackstab = false, Headshots = false }
  118. local KnifeAuraSettings = _G.KnifeAuraSettings
  119. local KnifeSection = AimbotPage:addSection("Knife Aura")
  120. KnifeSection:addToggle("Enabled", KnifeAuraSettings.Enabled, function(bool) KnifeAuraSettings.Enabled = bool end)
  121. KnifeSection:addSlider("Distance", KnifeAuraSettings.Distance, 1, 25, function(int) KnifeAuraSettings.Distance = int end)
  122. KnifeSection:addSlider("Cooldown", KnifeAuraSettings.Cooldown, 0, 10, function(int) KnifeAuraSettings.Cooldown = int end)
  123. KnifeSection:addToggle("Headshots", KnifeAuraSettings.Headshots, function(bool) KnifeAuraSettings.Headshots = bool end)
  124.  
  125. _G.ESPSettings = { Enabled = false, Chams = { Enabled = false, ViewportFrame } }
  126. local ESPSettings = _G.ESPSettings
  127.  
  128. local GUI = Instance.new("ScreenGui", game:GetService("CoreGui"))
  129. GUI.IgnoreGuiInset = true
  130.  
  131. local ViewportFrame = Instance.new("ViewportFrame", GUI)
  132. ViewportFrame.Size = UDim2.new(1, 0, 1, 0)
  133. ViewportFrame.CurrentCamera = workspace.CurrentCamera
  134. ViewportFrame.BackgroundTransparency = 1
  135. ViewportFrame.ImageTransparency = 0.25
  136. ViewportFrame.ImageColor3 = Color3.new(1, 1, 1)
  137. ESPSettings.Chams.ViewportFrame = ViewportFrame
  138.  
  139. local ChamsSection = ESPPage:addSection("Chams")
  140. ChamsSection:addToggle("Enabled", ESPSettings.Chams.Enabled, function(bool) ESPSettings.Chams.Enabled = bool end)
  141. ChamsSection:addColorPicker("Color", ESPSettings.Chams.ViewportFrame.ImageColor3, function(color) ESPSettings.Chams.ViewportFrame.ImageColor3 = color end)
  142. ChamsSection:addSlider("Transparency", ESPSettings.Chams.ViewportFrame.ImageTransparency * 100, 0, 100, function(number) ESPSettings.Chams.ViewportFrame.ImageTransparency = number / 100 end)
  143.  
  144. _G.OtherSettings = { ThirdSlot = false, SpotAll = false, FragAura = false, DespawnOnDanger = false, DespawnHealth = 15 }
  145. local OtherSettings = _G.OtherSettings
  146.  
  147. local OtherSection = OtherPage:addSection("Other")
  148. OtherSection:addToggle("Third weapon slot for dropped weapons", OtherSettings.ThirdSlot, function(bool) OtherSettings.ThirdSlot = bool end)
  149. OtherSection:addToggle("Spot everyone", OtherSettings.SpotAll, function(bool) OtherSettings.SpotAll = bool end)
  150. OtherSection:addToggle("Frag aura", OtherSettings.FragAura, function(bool) OtherSettings.FragAura = bool end)
  151.  
  152. OtherSection:addToggle("Despawn on danger", OtherSettings.DespawnOnDanger, function(bool) OtherSettings.DespawnOnDanger = bool end)
  153. OtherSection:addSlider("Danger health", OtherSettings.DespawnHealth, 1, 100, function(number) OtherSettings.DespawnHealth = number end)
  154.  
  155. OtherSection:addKeybind("Menu Keybind", Enum.KeyCode.P, function()
  156. _G.ui:toggle()
  157. end)
  158. end
  159.  
  160. local OtherSettings
  161. local ESPSettings
  162. local KnifeAuraSettings
  163. local AimbotSettings
  164. local ui
  165. local GunSection
  166.  
  167. CurrentGun = "AK12"
  168. CurrentGunTable = require(ReplicatedStorage.GunModules.AK12)
  169.  
  170. function CreateVectorControl(id, name, vec)
  171. local tbl = { }
  172.  
  173.  
  174. tbl[1] = GunSection:addSlider(name.." X", vec.X, 0, 5, function(val)
  175. vec.X = val
  176. end)
  177. tbl[2] = GunSection:addSlider(name.." Y", vec.Y, 0, 5, function(val)
  178. vec.Y = val
  179. end)
  180. tbl[3] = GunSection:addSlider(name.." Z", vec.Z, 0, 5, function(val)
  181. vec.Z = val
  182. end)
  183.  
  184. StatControls[id] = tbl
  185. end
  186.  
  187. function UpdateVectorControl(tbl, name, vec)
  188. GunSection:updateSlider(tbl[1], name.." X", vec.X, 0, 5)
  189. GunSection:updateSlider(tbl[2], name.." Y", vec.Y, 0, 5)
  190. GunSection:updateSlider(tbl[3], name.." Z", vec.Z, 0, 5)
  191. end
  192.  
  193. function UpdateControls()
  194. for k,v in pairs(StatInfos) do
  195. if v.Type == Type.Number then
  196. if StatControls[k] == nil then
  197. StatControls[k] = GunSection:addSlider(v.Name, tonumber(CurrentGunTable[k]) or 0, v.Min, v.Max, function(val)
  198. CurrentGunTable[k] = val
  199. end)
  200. else
  201. GunSection:updateSlider(StatControls[k], v.Name, tonumber(CurrentGunTable[k]) or 0, v.Min, v.Max)
  202. end
  203. elseif v.Type == Type.String then
  204. if StatControls[k] == nil then
  205. StatControls[k] = GunSection:addTextbox(v.Name, CurrentGunTable[k] or "", function(val)
  206. CurrentGunTable[k] = val
  207. end)
  208. else
  209. GunSection:updateTextbox(StatControls[k], v.Name, CurrentGunTable[k] or "")
  210. end
  211. elseif v.Type == Type.Bool then
  212. if StatControls[k] == nil then
  213. StatControls[k] = GunSection:addToggle(v.Name, CurrentGunTable[k] or false, function(val)
  214. CurrentGunTable[k] = val
  215. end)
  216. else
  217. GunSection:updateToggle(StatControls[k], v.Name, CurrentGunTable[k] or false)
  218. end
  219. elseif v.Type == Type.Enum then
  220. if StatControls[k] == nil then
  221. StatControls[k] = GunSection:addDropdown(v.Name, v.Enum, function(val)
  222. CurrentGunTable[k] = val
  223. end)
  224. else
  225. GunSection:updateDropdown(StatControls[k], v.Name, v.Enum, function(val)
  226. CurrentGunTable[k] = val
  227. end)
  228. end
  229. --[[elseif v.Type == Type.Vector then
  230. if StatControls[k] == nil then
  231. StatControls[k] = CreateVectorControl(k, v.Name, CurrentGunTable[k] or Vector3.new())
  232. else
  233. UpdateVectorControl(StatControls[k], v.Name, CurrentGunTable[k] or Vector3.new())
  234. end]]--
  235. end
  236. end
  237. end
  238.  
  239. function InvertTable(t)
  240. local s = { }
  241.  
  242. for k,v in pairs(t) do
  243. s[v] = k
  244. end
  245.  
  246. return s
  247. end
  248.  
  249. local function FindModule(fingerprints)
  250. local found = nil
  251.  
  252. for k,gco in pairs(getgc()) do
  253. if type(gco) == "function" then
  254. for i,v in pairs(getupvalues(gco)) do
  255. if type(v) == "table" then
  256. local valid = true
  257.  
  258. if type(fingerprints) == "table" then
  259. for fk, fv in pairs(fingerprints) do
  260. if rawget(v, fv) == nil then valid = false end
  261. end
  262. elseif type(fingerprints) == "string" then
  263. if rawget(v, fingerprints) == nil then valid = false end
  264. else
  265. error("Invalid fingerprints!")
  266. valid = false
  267. end
  268.  
  269. if valid then found = v end
  270. end
  271. end
  272. end
  273. end
  274.  
  275. if found == nil then
  276. error("Could not find this module!")
  277. else
  278. return found
  279. end
  280. end
  281.  
  282. local Modules = { }
  283. local PFTables = { }
  284. Modules.ModuleCache = FindModule("_cache")
  285. Modules.RagdollOwnerFinder = FindModule({"getplayerhit", "removecharacterhash"})
  286.  
  287. do
  288. local function GetCachedModule(name)
  289. if Modules.ModuleCache._cache[name] == nil then
  290. error("Module ".. name .." is not cached!")
  291. end
  292.  
  293. return Modules.ModuleCache._cache[name].module
  294. end
  295.  
  296. Modules.Character = GetCachedModule("char")
  297. Modules.Hud = GetCachedModule("hud")
  298. Modules.Physics = GetCachedModule("physics")
  299. Modules.Effects = GetCachedModule("effects")
  300. Modules.Network = GetCachedModule("network")
  301. Modules.Camera = GetCachedModule("camera")
  302. Modules.Vector = GetCachedModule("vector")
  303. Modules.CFrame = GetCachedModule("cframe")
  304. Modules.Replication = GetCachedModule("replication")
  305. end
  306.  
  307. function GetBulletDrop(pos)
  308. local offset = Vector3.new()
  309. local acceleration = Vector3.new(0, -196.2, 0)
  310.  
  311. return Modules.Physics.trajectory(workspace.CurrentCamera.CFrame.p,
  312. offset,
  313. acceleration,
  314. pos,
  315. offset,
  316. offset,
  317. PFTables.WeaponInfo.currentgun.data.bulletspeed)
  318. end
  319.  
  320. function SetCameraLookVector(ang, p38, p39)
  321. local v1 = Modules.Camera
  322.  
  323. if p38 and p39 then
  324. local v31 = math.cos(tick());
  325. local v32 = math.sin(tick());
  326. p38 = v31 * p38 - v32 * p39;
  327. p39 = v32 * p38 + v31 * p39;
  328. end;
  329.  
  330. local v33, v34 = Modules.Vector.toanglesyx(ang);
  331. local v35 = v33 + (p38 or 0);
  332. local l__y__36 = v1.angles.y;
  333.  
  334. local v37 = Vector3.new(
  335. v1.maxangle < v35
  336. and v1.maxangle
  337. or (v35 < v1.minangle and v1.minangle or v35),
  338. (v34 + (p39 or 0)
  339. + math.pi - l__y__36)
  340. % (2 * math.pi)
  341. - math.pi + l__y__36, 0);
  342.  
  343. v1.delta = Vector3.new() -- (v37 - v1.angles) / 0.016666666666666666;
  344. v1.angles = v37;
  345. end;
  346.  
  347. PFTables.WeaponInfo = debug.getupvalue(Modules.Character.setsprint, 1)
  348.  
  349. function GetCurWeaponModel()
  350. for k,v in pairs(workspace.CurrentCamera:GetChildren()) do
  351. if tostring(v) ~= "Left Arm" and tostring(v) ~= "Right Arm" then
  352. return v
  353. end
  354. end
  355.  
  356. return nil
  357. end
  358.  
  359. PFTables.RagdollOwners = debug.getupvalue(Modules.RagdollOwnerFinder.getplayerhit, 1)
  360.  
  361. function CamAngleTo(Position)
  362. local cam = workspace.CurrentCamera
  363. local dVec = (Position - cam.CFrame.p).unit
  364. return math.deg(math.acos(cam.CFrame.LookVector:Dot(dVec)))
  365. end
  366.  
  367. function CamAngleToPart(part)
  368. return CamAngleTo(part.CFrame.p)
  369. end
  370.  
  371. function GetWindows()
  372. local wnd = { }
  373.  
  374. for k,v in pairs(game:GetService("Workspace").Map:GetChildren()) do
  375. if v.Name == "Window" then table.insert(wnd, v) end
  376. end
  377.  
  378. return wnd
  379. end
  380.  
  381. function CanSeeOrPenetrate(Part, owner)
  382. local cam = workspace.CurrentCamera
  383. local Ray = Ray.new(cam.CFrame.p, (Part.Position - cam.CFrame.p) * 1.1)
  384. local Ignore = {LocalPlayer, cam, GetCurWeaponModel(), game:GetService("Workspace").Ignore}
  385. local part = workspace:FindPartOnRayWithIgnoreList(Ray,Ignore)
  386.  
  387. if part == Part then
  388. return true
  389. elseif owner ~= nil and part ~= nil and part:IsDescendantOf(owner) then
  390. return true
  391. end
  392.  
  393. return false
  394. end
  395.  
  396. local CachedPositions = { }
  397. local wasShootingLastFrame = false
  398.  
  399. getgenv().AimbotLogic = function(ft)
  400. if PFTables.WeaponInfo.currentgun == nil or PFTables.WeaponInfo.currentgun.shoot == nil then return end
  401.  
  402. if wasShootingLastFrame then
  403. PFTables.WeaponInfo.currentgun:shoot(false)
  404. wasShootingLastFrame = false
  405. end
  406.  
  407. if not AimbotSettings.Enabled then
  408. return
  409. end
  410.  
  411. local aimpart = AimbotSettings.AimPart
  412.  
  413. for _,v in pairs(Input:GetMouseButtonsPressed()) do
  414. if v.UserInputType == Enum.UserInputType.MouseButton2 then
  415. if PFTables.WeaponInfo.currentgun == nil then
  416. break
  417. end
  418.  
  419. local function FindNearestPlayer(fov, aimpart)
  420. local nearest, bestdist = nil, fov
  421.  
  422. for k, v in pairs(PFTables.RagdollOwners) do
  423. if v ~= LocalPlayer
  424. and v.Team ~= LocalPlayer.Team
  425. and k:FindFirstChild(aimpart) ~= nil
  426. then
  427.  
  428. local part = k:FindFirstChild(aimpart)
  429. if part ~= nil
  430. and (workspace.CurrentCamera.CFrame.Position - part.Position).magnitude < 5000
  431. and CanSeeOrPenetrate(part, k) then
  432. local dist = CamAngleToPart(part)
  433. if dist < bestdist or fov == 0 then
  434. bestdist = dist
  435. nearest = k
  436. end
  437. end
  438. end
  439. end
  440.  
  441. return nearest
  442. end
  443.  
  444. local nearest = FindNearestPlayer(AimbotSettings.FOV, aimpart)
  445. if nearest == nil then break end
  446. local bone = nearest:FindFirstChild(aimpart)
  447. if bone == nil then break end
  448.  
  449. local vel = Vector3.new(0, 0, 0)
  450. if CachedPositions[nearest] ~= nil then
  451. vel = (CachedPositions[nearest].pos - nearest:FindFirstChild("Torso").Position) / (CachedPositions[nearest].time - tick()) -- So somehow... Its a directional vector.
  452. end
  453.  
  454. local weapon = GetCurWeaponModel()
  455. local shootPart = weapon[
  456. PFTables.WeaponInfo.currentgun.isaiming()
  457. and PFTables.WeaponInfo.currentgun.data.sightpart
  458. or PFTables.WeaponInfo.currentgun.data.barrel
  459. ]
  460.  
  461. local traveltime = (bone.Position - workspace.CurrentCamera.CFrame.p).magnitude / PFTables.WeaponInfo.currentgun.data.bulletspeed
  462. local bulletdrop = GetBulletDrop(bone.Position)
  463.  
  464. local v3aimpos = bone.Position + bulletdrop
  465. local aimdir =
  466. (
  467. v3aimpos
  468. - workspace.CurrentCamera.CFrame.p
  469. + vel
  470. - CFrame.new(workspace.CurrentCamera.CFrame.p, workspace.CurrentCamera.CFrame.p - shootPart.CFrame.p).LookVector
  471. ).unit
  472. local fullaimdir = aimdir + (workspace.CurrentCamera.CFrame.LookVector
  473. - shootPart.CFrame.LookVector)
  474.  
  475. if AimbotSettings.Smooth == 0 then
  476. SetCameraLookVector(fullaimdir)
  477. else
  478. local orgAngles = Modules.Camera.angles
  479. SetCameraLookVector(Modules.Vector.anglesyx(orgAngles.x, orgAngles.y):Lerp(fullaimdir, AimbotSettings.Smooth / 100 * ft))
  480. end
  481.  
  482. local cam = Modules.Camera
  483. cam.swayspring.d = math.huge
  484. cam.swayspeed.d = math.huge
  485. cam.swayspring.d = math.huge
  486. cam.shakespring.d = math.huge
  487.  
  488. if AimbotSettings.Autofire then
  489. PFTables.WeaponInfo.currentgun:shoot(true)
  490. wasShootingLastFrame = true
  491. end
  492.  
  493. break
  494. end
  495. end
  496.  
  497. for k, v in pairs(PFTables.RagdollOwners) do
  498. if v ~= LocalPlayer
  499. and v.Team ~= LocalPlayer.Team
  500. and k:FindFirstChild("Torso") ~= nil
  501. then
  502.  
  503. CachedPositions[k] = { pos = k:FindFirstChild("Torso").Position, time = tick() }
  504. end
  505. end
  506. end
  507.  
  508.  
  509. function SyncCFrames(src, dst)
  510. for PartName, Part in pairs(src:GetChildren()) do
  511. local ClonePart = dst:FindFirstChild(Part.Name)
  512.  
  513. if ClonePart ~= nil then
  514. if (Part:IsA("Part") or Part:IsA("MeshPart")) then
  515. ClonePart.CFrame = Part.CFrame
  516. end
  517.  
  518. SyncCFrames(Part, ClonePart)
  519. end
  520. end
  521. end
  522.  
  523. local RagdollChamsModels = { }
  524.  
  525. _G.UpdateChams = function()
  526. local Players = PFTables.RagdollOwners
  527. local Ragdolls = InvertTable(PFTables.RagdollOwners)
  528.  
  529. for m, cm in pairs(RagdollChamsModels) do
  530. if Players[m] == nil or not ESPSettings.Chams.Enabled then
  531. RagdollChamsModels[m]:Remove()
  532. RagdollChamsModels[m] = nil
  533. end
  534. end
  535.  
  536. if ESPSettings.Chams.Enabled then
  537. for ply, ragdoll in pairs(Ragdolls) do
  538. if RagdollChamsModels[ragdoll] == nil then
  539. ragdoll.Archivable = true
  540. local Clone = ragdoll:Clone()
  541. if Clone ~= nil then
  542. Clone.Parent = ESPSettings.Chams.ViewportFrame
  543.  
  544. RagdollChamsModels[ragdoll] = Clone
  545. end
  546. end
  547.  
  548. if RagdollChamsModels[ragdoll] ~= nil then
  549. SyncCFrames(ragdoll, RagdollChamsModels[ragdoll])
  550. end
  551. end
  552. end
  553. end
  554.  
  555. local auraCD = 0
  556. _G.KnifeAuraLogic = function(ft)
  557. auraCD = math.clamp(auraCD - ft, 0, KnifeAuraSettings.Cooldown)
  558. if not KnifeAuraSettings.Enabled or auraCD > 0 then return end
  559.  
  560. local bestdist = KnifeAuraSettings.Distance
  561. local bestply, bestrag
  562. for ply, ragdoll in pairs(InvertTable(PFTables.RagdollOwners)) do
  563. if ply.Team ~= LocalPlayer.Team then
  564. local root = ragdoll:FindFirstChild('HumanoidRootPart')
  565.  
  566. if root ~= nil then
  567. local dist = (workspace.CurrentCamera.CFrame.p - root.CFrame.p).magnitude
  568. if bestdist > dist then
  569. bestdist = dist
  570. bestply = ply
  571. bestrag = ragdoll
  572. end
  573. end
  574. end
  575. end
  576.  
  577. if bestply ~= nil then
  578. Modules.Network:send("knifehit", bestply, tick(),
  579. KnifeAuraSettings.Headshots
  580. and bestrag.Head
  581. or bestrag.HumanoidRootPart)
  582. auraCD = KnifeAuraSettings.Cooldown
  583. Modules.Hud:firehitmarker(KnifeAuraSettings.Headshots)
  584. end
  585. end
  586.  
  587. local spotCD = 0
  588. _G.SpotAll = function(ft)
  589. stopCD = math.clamp(spotCD - ft, 0, 1)
  590. if not OtherSettings.SpotAll or spotCD > 0 then return end
  591.  
  592. local players = { }
  593.  
  594. for ply, ragdoll in pairs(InvertTable(PFTables.RagdollOwners)) do
  595. if ply.Team ~= LocalPlayer.Team then
  596. table.insert(players, ply)
  597. end
  598. end
  599.  
  600. if #players > 0 then
  601. Modules.Network:send("spotplayers", players)
  602. spotCD = 1
  603. end
  604. end
  605.  
  606. _G.DespawnOnDanger = function()
  607. if not OtherSettings.DespawnOnDanger or Modules.Character.health == 0 then return end
  608.  
  609. if Modules.Character.health < OtherSettings.DespawnHealth then
  610. Modules.Character:despawn()
  611. end
  612. end
  613.  
  614. _G.FragAura = function(orgt)
  615. if not OtherSettings.FragAura then return orgt end
  616.  
  617. local bestdist = 25
  618. local bestply, bestrag
  619. for ply, ragdoll in pairs(InvertTable(PFTables.RagdollOwners)) do
  620. if ply.Team ~= LocalPlayer.Team then
  621. local root = ragdoll:FindFirstChild('HumanoidRootPart')
  622.  
  623. if root ~= nil then
  624. local dist = (workspace.CurrentCamera.CFrame.p - root.CFrame.p).magnitude
  625. if bestdist < dist then
  626. bestdist = dist
  627. bestply = ply
  628. bestrag = ragdoll
  629. end
  630. end
  631. end
  632. end
  633.  
  634. if bestply == nil then return orgt end
  635.  
  636. local tbl = {
  637. curi = 1,
  638. time = tick(),
  639. blowuptime = 0,
  640. frames = {
  641. {
  642. t0 = 0,
  643. p0 = bestrag.Head.CFrame.p,
  644. v0 = Vector3.new(0, -1, 0),
  645. offset = Vector3.new(),
  646. a = Vector3.new(),
  647. rot0 = CFrame.new(workspace.CurrentCamera.CFrame.p, Vector3.new(0, -1, 0)),
  648. rotv = Vector3.new(0, -1, 0),
  649. glassbreaks = {}
  650. }
  651. }
  652. };
  653.  
  654. return tbl
  655. end
  656.  
  657. if getgenv().AOSRUN == nil then
  658. InitUI()
  659. end
  660.  
  661. GunSection = _G.gunsect
  662. ui = _G.ui
  663. AimbotSettings = _G.AimbotSettings
  664. ESPSettings = _G.ESPSettings
  665. OtherSettings = _G.OtherSettings
  666. KnifeAuraSettings = _G.KnifeAuraSettings
  667.  
  668. if getgenv().AOSRUN == nil then
  669. UpdateControls()
  670. game:GetService("RunService").RenderStepped:Connect(function(ft)
  671. getgenv().AimbotLogic(ft)
  672. _G.KnifeAuraLogic(ft)
  673. _G.SpotAll(ft)
  674. _G.DespawnOnDanger()
  675.  
  676. _G.UpdateChams()
  677. end)
  678.  
  679. _G.orgsend = hookfunction(Modules.Network.send, function(net, name, ...)
  680. if OtherSettings.ThirdSlot and name == "swapgun" then
  681. local tbl = {...}
  682. if tostring(tbl[1]) == "Dropped" then
  683. tbl[2] = 3
  684. return _G.orgsend(net, name, unpack(tbl))
  685. end
  686. end
  687.  
  688. if OtherSettings.FragAura and name == "newgrenade" then
  689. local tbl = {...}
  690. tbl[2] = _G.FragAura(tbl[2])
  691. return _G.orgsend(net, name, unpack(tbl))
  692. end
  693.  
  694. return _G.orgsend(net, name, ...)
  695. end)
  696. end
  697.  
  698. getgenv().AOSRUN = true
  699.  
  700. ui:SelectPage(ui.pages[1], true)
  701.  
Add Comment
Please, Sign In to add comment