Nosssa

Hood Customs Silent Aim ( PATCHED | OPEN SOURCE )

Aug 29th, 2022 (edited)
1,474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.60 KB | None | 0 0
  1. -- IF U ARE SMART U CAN SCROLL DOWN TO CHANGE THE SETS | CTRL + F SEARCH: R_Assign_Predict
  2.  
  3. getgenv().Toggle_Key = "c"
  4.  
  5.  
  6. getgenv().Rejoin_Key = "="
  7.  
  8.  
  9. getgenv().ChangeFovSettings = {
  10.  
  11.     FOV_Filled = false;
  12.     FOV_VisibleOrNot = true;
  13.     FOV_Transparency = .35;
  14.     FOV_Thickness = 1;
  15.     FOV_RADIUS = 250;
  16.     FOV_Color = Color3.fromRGB(200, 200, 255);
  17.  
  18. };
  19.  
  20.  
  21. getgenv = getgenv
  22. Drawing = Drawing
  23. setreadonly = setreadonly
  24. newcclosure = newcclosure
  25. getrawmetatable = getrawmetatable
  26. getnamecallmethod = getnamecallmethod
  27.  
  28.  
  29. local IsToggled = false
  30. local EventName = "GetMousePos"
  31. local Players = game:GetService("Players")
  32. local LocalPlayer = Players.LocalPlayer
  33. local Mouse = LocalPlayer:GetMouse()
  34. local Network_Status = game:GetService("Stats")
  35. local RunService = game:GetService("RunService")
  36. local Camera = game:GetService("Workspace").CurrentCamera
  37. local UserInputService = game:GetService("UserInputService")
  38. local TheRemote = game:GetService("ReplicatedStorage").MainEvent
  39.  
  40.  
  41. local FOV_CIRCLE = Drawing.new("Circle")
  42. FOV_CIRCLE.Filled = getgenv().ChangeFovSettings.FOV_Filled
  43. FOV_CIRCLE.Color = getgenv().ChangeFovSettings.FOV_Color
  44. FOV_CIRCLE.Radius = getgenv().ChangeFovSettings.FOV_RADIUS
  45. FOV_CIRCLE.Thickness = getgenv().ChangeFovSettings.FOV_Thickness
  46. FOV_CIRCLE.Visible = getgenv().ChangeFovSettings.FOV_VisibleOrNot
  47. FOV_CIRCLE.Transparency = getgenv().ChangeFovSettings.FOV_Transparency
  48. FOV_CIRCLE.Position = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
  49.  
  50.  
  51. local Move_FOV = nil
  52. Move_FOV = RunService.RenderStepped:Connect(function()
  53.     FOV_CIRCLE.Position = Vector2.new(UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y)
  54. end)
  55.  
  56. Mouse.KeyDown:Connect(function(Rejoin)
  57.     if Rejoin == (getgenv().Rejoin_Key:lower()) then
  58.         game:GetService("TeleportService"):Teleport(game.PlaceId, LocalPlayer) task.wait()
  59.     end
  60. end)
  61.  
  62.  
  63. function InRadius()
  64.     local Target = nil
  65.     local Distance = 9e9
  66.     local Camera = game:GetService("Workspace").CurrentCamera
  67.     for _, v in pairs(Players:GetPlayers()) do
  68.         if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("Head") and v.Character:FindFirstChildOfClass("Humanoid") and v.Character:FindFirstChildOfClass("Humanoid").Health > 0 then
  69.             local Enemy = v.Character
  70.             local CastingFrom = CFrame.new(Camera.CFrame.Position, Enemy:FindFirstChild("Head").CFrame.Position) * CFrame.new(0, 0, -4)
  71.             local RayCast = Ray.new(CastingFrom.Position, CastingFrom.LookVector * 9000)
  72.             local World, ToSpace = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(RayCast, {LocalPlayer.Character:FindFirstChild("Head")});
  73.             local RootWorld = (Enemy:FindFirstChild("Head").CFrame.Position - ToSpace).magnitude
  74.             if RootWorld < 4 then      
  75.                 local RootPartPosition, Visible = Camera:WorldToViewportPoint(Enemy:FindFirstChild("Head").Position)
  76.                 if Visible then
  77.                     local Real_Magnitude = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(RootPartPosition.X, RootPartPosition.Y)).Magnitude
  78.                     if Real_Magnitude < Distance and Real_Magnitude < FOV_CIRCLE.Radius then
  79.                         Distance = Real_Magnitude
  80.                         Target = Enemy
  81.                     end
  82.                 end
  83.             end
  84.         end
  85.     end
  86.     return Target
  87. end
  88.  
  89. local Base_Prediction = (.01)
  90. local Automated_Prediction = true
  91. local Update_Prediction = nil
  92. local Last_Prediction_Value = nil
  93. function AutoPredict()
  94.     if Automated_Prediction then
  95.         local Average_Ping = Network_Status.PerformanceStats.Ping:GetValue()
  96.         local Rounded_Ping = math.round(Average_Ping)
  97.         local N_Possibilities = { --#Possible Ping(s), Rounded To The Nearest 10.
  98.  
  99.             5,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180 --#SETS_COUNT [ 17 ]
  100.  
  101.         };
  102.         local R_Assign_Predict = { --#Assign Prediction Values Per Sets.
  103.  
  104.             .158,.16,.163,.165,.166,.168,.17,.171,.173,.174,.176,.178,.181,.184,.188,.19,.23,.27,.32 --#SETS_COUNT [ 17 ]
  105.  
  106.         };
  107.         if (Rounded_Ping) <= (N_Possibilities[1]) then
  108.             Base_Prediction = (R_Assign_Predict[1])
  109.         elseif (Rounded_Ping) <= (N_Possibilities[2]) then
  110.             Base_Prediction = (R_Assign_Predict[2])
  111.         elseif (Rounded_Ping) <= (N_Possibilities[3]) then
  112.             Base_Prediction = (R_Assign_Predict[3])
  113.         elseif (Rounded_Ping) <= (N_Possibilities[4]) then
  114.             Base_Prediction = (R_Assign_Predict[4])
  115.         elseif (Rounded_Ping) <= (N_Possibilities[5]) then
  116.             Base_Prediction = (R_Assign_Predict[5])
  117.         elseif (Rounded_Ping) <= (N_Possibilities[6]) then
  118.             Base_Prediction = (R_Assign_Predict[6])
  119.         elseif (Rounded_Ping) <= (N_Possibilities[7]) then
  120.             Base_Prediction = (R_Assign_Predict[7])
  121.         elseif (Rounded_Ping) <= (N_Possibilities[8]) then
  122.             Base_Prediction = (R_Assign_Predict[8])
  123.         elseif (Rounded_Ping) <= (N_Possibilities[9]) then
  124.             Base_Prediction = (R_Assign_Predict[9])
  125.         elseif (Rounded_Ping) <= (N_Possibilities[10]) then
  126.             Base_Prediction = (R_Assign_Predict[10])
  127.         elseif (Rounded_Ping) <= (N_Possibilities[11]) then
  128.             Base_Prediction = (R_Assign_Predict[11])
  129.         elseif (Rounded_Ping) <= (N_Possibilities[12]) then
  130.             Base_Prediction = (R_Assign_Predict[12])
  131.         elseif (Rounded_Ping) <= (N_Possibilities[13]) then
  132.             Base_Prediction = (R_Assign_Predict[13])
  133.         elseif (Rounded_Ping) <= (N_Possibilities[14]) then
  134.             Base_Prediction = (R_Assign_Predict[14])
  135.         elseif (Rounded_Ping) <= (N_Possibilities[15]) then
  136.             Base_Prediction = (R_Assign_Predict[15])
  137.         elseif (Rounded_Ping) <= (N_Possibilities[16]) then
  138.             Base_Prediction = (R_Assign_Predict[16])
  139.         elseif (Rounded_Ping) > (N_Possibilities[17]) then
  140.             Base_Prediction = (R_Assign_Predict[17])
  141.         end
  142.     end
  143. end
  144.  
  145. Update_Prediction = RunService.Stepped:Connect(function()
  146.     if Automated_Prediction then
  147.         AutoPredict()
  148.         Last_Prediction_Value = Base_Prediction
  149.     elseif Automated_Prediction == false then
  150.         Base_Prediction = Last_Prediction_Value / 1.2
  151.     end
  152. end)
  153.  
  154.  
  155. local Draw = Drawing.new
  156. local Square = Drawing.new("Square")
  157. Square.Visible = false
  158. Square.Color = Color3.fromRGB(85, 255, 255)
  159. Square.Thickness = 20
  160. Square.Size = Vector2.new(20,20)
  161. Square.Filled = true
  162.  
  163. local Enemy = nil
  164. local Branded_Plr = nil
  165. function GrabSilentRadius()
  166.     pcall(function()
  167.         if IsToggled then
  168.             Enemy = InRadius()
  169.             if Enemy ~= nil then
  170.                 Branded_Plr = Enemy
  171.             elseif Enemy == nil then
  172.                 Branded_Plr = nil
  173.             end
  174.         end
  175.     end)
  176. end
  177.  
  178. Mouse.KeyDown:Connect(function(Toggled)
  179.     if Toggled == (getgenv().Toggle_Key:lower()) then
  180.         if IsToggled == false then
  181.             IsToggled = true
  182.             GrabSilentRadius()
  183.         elseif IsToggled == true then
  184.             IsToggled = false
  185.             Enemy = nil
  186.             Branded_Plr = nil
  187.             Square.Visible = false
  188.         end
  189.     end
  190. end)
  191.  
  192.  
  193. AimAt = {
  194.     Head = "Head";
  195.     Torso = "HumanoidRootPart";
  196.     UpperTorso = "UpperTorso"
  197. };
  198.  
  199.  
  200. gmt = getrawmetatable(game)
  201. SilentIndex = gmt.__namecall
  202. setreadonly(gmt, false)
  203. gmt.__namecall = newcclosure(function(...)
  204.     local Args = {...};
  205.     local Target = Branded_Plr
  206.     if IsToggled and getnamecallmethod() == "FireServer" and Args[2] == "GetMousePos" then
  207.         local What = Target[AimAt.Torso].Position + Target[AimAt.Torso].AssemblyLinearVelocity * Base_Prediction --Target:FindFirstChild("HumanoidRootPart").Position + (Target:FindFirstChild("HumanoidRootPart").Velocity)
  208.         Args[3] = What
  209.         return SilentIndex(unpack(Args))
  210.     end
  211.     return SilentIndex(...)
  212. end)
  213.  
  214.  
  215. RunService.Stepped:Connect(function()
  216.     pcall(function()
  217.         if Branded_Plr ~= nil then
  218.             local Vector, OnScreen = game:GetService("Workspace").CurrentCamera:WorldToViewportPoint(Branded_Plr:FindFirstChild("HumanoidRootPart").Position + (Branded_Plr:FindFirstChild("HumanoidRootPart").AssemblyLinearVelocity * Base_Prediction))
  219.             if OnScreen then
  220.                 Square.Visible = true
  221.                 Square.Position = Vector2.new(Vector.X,Vector.Y)
  222.             end
  223.         end
  224.     end)
  225. end)
Add Comment
Please, Sign In to add comment