1. local CHEAT_CLIENT = {} do
  2. do
  3. CHEAT_CLIENT.player = game.Players.LocalPlayer
  4. CHEAT_CLIENT.camera = game.Workspace.CurrentCamera
  5. CHEAT_CLIENT.mouse = CHEAT_CLIENT.player:GetMouse()
  6. end
  7. do
  8. function CHEAT_CLIENT:get_target()
  9. local current_target = nil
  10. local maximum_distance = math.huge
  11. for i,v in pairs(game.Players:GetPlayers()) do
  12. if v == game.Players.LocalPlayer then continue end
  13. if v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  14. local position, on_screen = CHEAT_CLIENT.camera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  15. if not on_screen then continue end
  16. local distance = (Vector2.new(position.X, position.Y - game.GuiService:GetGuiInset(game.GuiService).Y) - Vector2.new(CHEAT_CLIENT.mouse.X, CHEAT_CLIENT.mouse.Y)).Magnitude
  17. if distance > maximum_distance then continue end
  18. current_target = v
  19. maximum_distance = distance
  20. end
  21. end
  22. return current_target
  23. end
  24. function CHEAT_CLIENT:predict_velocity(target_part, projectile_speed)
  25. local velocity = target_part.Velocity
  26. local distance = (CHEAT_CLIENT.camera.CFrame.p - target_part.CFrame.p).Magnitude
  27. local time_to_hit = (distance / projectile_speed)
  28. local predicted_position = target_part.CFrame.p + (velocity * time_to_hit)
  29. local delta = (predicted_position - target_part.CFrame.p).Magnitude
  30. local final_projectile_speed = projectile_speed - 0.013 * projectile_speed ^ 2 * time_to_hit ^ 2
  31. time_to_hit += (delta / final_projectile_speed)
  32. return target_part.CFrame.p + (velocity * time_to_hit)
  33. end
  34. function CHEAT_CLIENT:predict_drop(target_part, projectile_speed, projectile_drop)
  35. local distance = (CHEAT_CLIENT.camera.CFrame.p - target_part.CFrame.p).Magnitude
  36. local time_to_hit = (distance / projectile_speed)
  37. local final_projectile_speed = projectile_speed - 0.013 * projectile_speed ^ 2 * time_to_hit ^ 2
  38. time_to_hit += (distance / final_projectile_speed)
  39. local drop_timing = projectile_drop * time_to_hit ^ 2
  40. if not tostring(drop_timing):find("nan") then
  41. return drop_timing
  42. end
  43. return 0
  44. end
  45. function CHEAT_CLIENT:get_bullet_atribute(attribute)
  46. local attribute_value = nil
  47. local status = game.ReplicatedStorage.Players[CHEAT_CLIENT.player.Name]:FindFirstChild("Status")
  48. if status then
  49. local equipped_tool = status.GameplayVariables.EquippedTool.Value
  50. if equipped_tool then
  51. local inventory_equipped_tool = game.ReplicatedStorage.Players[CHEAT_CLIENT.player.Name].Inventory:FindFirstChild(tostring(equipped_tool))
  52. if inventory_equipped_tool then
  53. local mag = inventory_equipped_tool.Attachments:FindFirstChild("Magazine") and inventory_equipped_tool.Attachments:FindFirstChild("Magazine"):FindFirstChildOfClass("StringValue") and inventory_equipped_tool.Attachments:FindFirstChild("Magazine"):FindFirstChildOfClass("StringValue"):FindFirstChild("ItemProperties").LoadedAmmo or inventory_equipped_tool.ItemProperties:FindFirstChild("LoadedAmmo")
  54. if mag then
  55. local first_bullet_type = mag:FindFirstChild("1")
  56. if first_bullet_type then
  57. attribute_value = game.ReplicatedStorage.AmmoTypes[first_bullet_type:GetAttribute("AmmoType")]:GetAttribute(attribute)
  58. end
  59. end
  60. end
  61. end
  62. end
  63. return attribute_value
  64. end
  65. end
  66. end
  67. local silent_aim_hook; silent_aim_hook = hookfunction(require(game.ReplicatedStorage.Modules.FPS.Bullet).CreateBullet, function(...)
  68. local args = {...}
  69. if CHEAT_CLIENT:get_target() then
  70. local attribute_velocity = CHEAT_CLIENT:get_bullet_atribute("MuzzleVelocity")
  71. local attribute_drop = CHEAT_CLIENT:get_bullet_atribute("ProjectileDrop")
  72. local target_part = CHEAT_CLIENT:get_target() and CHEAT_CLIENT:get_target().Character:FindFirstChild("Head")
  73. if attribute_velocity and attribute_drop and target_part then
  74. args[9] = {CFrame = CFrame.new(args[9].CFrame.p, CHEAT_CLIENT:predict_velocity(target_part, attribute_velocity) + Vector3.new(0, CHEAT_CLIENT:predict_drop(target_part, attribute_velocity, attribute_drop), 0))}
  75. end
  76. end
  77. return silent_aim_hook(unpack(args))
  78. end)