local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LocalPlayer = Players.LocalPlayer

getgenv().Config = {
    Enabled = true,
    Players = false,
    FOV = 150,
    ShowFOV = true,
    DummyTargets = {"dummy", "DPS dummy"},
    StickyBonus = 0.8,
    VisibilityCheck = true,
    MenuKeybind = Enum.KeyCode.RightShift
}

local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/bo-xd/Bhub-remastered/refs/heads/main/src/util/ui/DrawingUILib.lua"))()
local ESP = loadstring(game:HttpGet("https://raw.githubusercontent.com/bo-xd/Bhub-remastered/refs/heads/main/src/util/Esp.lua"))()

local FovCircle = Drawing.new("Circle")
FovCircle.Thickness = 1
FovCircle.NumSides = 64
FovCircle.Radius = getgenv().Config.FOV
FovCircle.Color = Color3.new(1, 1, 1)
FovCircle.Visible = getgenv().Config.ShowFOV

local TargetTracer = Drawing.new("Line")
TargetTracer.Thickness = 1
TargetTracer.Color = Color3.fromRGB(255, 0, 0)
TargetTracer.Visible = false

local CurrentTarget = nil

local function IsVisible(part)
    local Camera = Workspace.CurrentCamera
    if not Camera then return false end
    local params = RaycastParams.new()
    params.FilterType = Enum.RaycastFilterType.Exclude
    params.FilterDescendantsInstances = {LocalPlayer.Character, part.Parent, Workspace:FindFirstChild("ViewModels")}
    local result = Workspace:Raycast(Camera.CFrame.Position, (part.Position - Camera.CFrame.Position), params)
    return result == nil
end

local function GetClosest()
    if not getgenv().Config.Enabled then return nil end
    local Camera = Workspace.CurrentCamera
    if not Camera then return nil end
    local MousePos = UserInputService:GetMouseLocation()
    local Closest, BestDist = nil, getgenv().Config.FOV
    
    if CurrentTarget and CurrentTarget.Parent then
        local pos, onScreen = Camera:WorldToViewportPoint(CurrentTarget.Position)
        if onScreen then
            local dist = (Vector2.new(pos.X, pos.Y) - MousePos).Magnitude
            if dist < getgenv().Config.FOV * 1.2 and (not getgenv().Config.VisibilityCheck or IsVisible(CurrentTarget)) then
                Closest, BestDist = CurrentTarget, dist * getgenv().Config.StickyBonus
            end
        end
    end

    local function checkEntity(entity)
        local Part = entity:IsA("Model") and (entity:FindFirstChild("Head") or entity:FindFirstChild("HumanoidRootPart") or entity.PrimaryPart) or (entity:IsA("BasePart") and entity)
        if Part and Part ~= CurrentTarget then
            local pos, onScreen = Camera:WorldToViewportPoint(Part.Position)
            if onScreen then
                local dist = (Vector2.new(pos.X, pos.Y) - MousePos).Magnitude
                if dist < BestDist and (not getgenv().Config.VisibilityCheck or IsVisible(Part)) then
                    Closest, BestDist = Part, dist
                end
            end
        end
    end

    if getgenv().Config.Players then
        for _, p in pairs(Players:GetPlayers()) do
            if p ~= LocalPlayer and p.Character and p.Character:FindFirstChild("Humanoid") and p.Character.Humanoid.Health > 0 then
                checkEntity(p.Character)
            end
        end
    else
        local Entities = Workspace:FindFirstChild("ShootingRangeEntities")
        if Entities then
            for _, Entity in pairs(Entities:GetChildren()) do
                local name = Entity.Name:lower()
                local isValid = false
                for _, t in pairs(getgenv().Config.DummyTargets) do if name:find(t:lower()) then isValid = true break end end
                if isValid then checkEntity(Entity) end
            end
        end
    end
    return Closest
end

local oldNamecall
oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(self, ...)
    local method = getnamecallmethod()
    local args = {...}
    if not checkcaller() and self == Workspace and (method == "Raycast" or method == "raycast") and CurrentTarget then
        local origin = args[1]
        local direction = args[2]
        if typeof(origin) == "Vector3" and typeof(direction) == "Vector3" and direction.Magnitude > 50 then
            args[2] = (CurrentTarget.Position - origin).Unit * direction.Magnitude
            return oldNamecall(self, unpack(args))
        end
    end
    return oldNamecall(self, ...)
end))

local oldNewIndex
oldNewIndex = hookmetamethod(game, "__newindex", function(self, index, value)
    if not checkcaller() then
        return oldNewIndex(self, index, value)
    end
    if value == game then
        return nil
    end
    return oldNewIndex(self, index, value)
end)

local function SyncESP()
    ESP:Clear()
    if getgenv().Config.Players then
        local function setupPlayer(p)
            if p == LocalPlayer then return end
            p.CharacterAdded:Connect(function(char)
                if getgenv().Config.Players then 
                    char:WaitForChild("HumanoidRootPart", 5)
                    ESP:Add(char, {Name = p.Name, Color = ESP.BoxColor}) 
                end
            end)
            if p.Character then ESP:Add(p.Character, {Name = p.Name, Color = ESP.BoxColor}) end
        end
        Players.PlayerAdded:Connect(setupPlayer)
        for _, p in pairs(Players:GetPlayers()) do setupPlayer(p) end
    else
        local Entities = Workspace:FindFirstChild("ShootingRangeEntities")
        if Entities then
            local function add(child)
                local name = child.Name:lower()
                local isValid = false
                for _, t in pairs(getgenv().Config.DummyTargets) do if name:find(t:lower()) then isValid = true break end end
                if isValid then ESP:Add(child, {Name = child.Name, Color = ESP.BoxColor}) end
            end
            Entities.ChildAdded:Connect(function(c) if not Config.Players then add(c) end end)
            for _, child in pairs(Entities:GetChildren()) do add(child) end
        end
    end
end

local Win = Library:CreateWindow({Title = "BHub Remastered | Rivals"})
local CombatTab = Win:AddTab("Combat")
local EspTab = Win:AddTab("ESP")
local SettingsTab = Win:AddTab("Settings")

local MainGroup = CombatTab:AddLeftGroupbox("Main")
MainGroup:AddToggle("Enabled", {Text = "Aimbot Enabled", Default = true, Callback = function(v) getgenv().Config.Enabled = v end})
MainGroup:AddToggle("Players", {Text = "Target Players", Default = false, Callback = function(v) getgenv().Config.Players = v; SyncESP() end})
MainGroup:AddToggle("Visibility", {Text = "Visibility Check", Default = true, Callback = function(v) getgenv().Config.VisibilityCheck = v end})
MainGroup:AddSlider("FOV", {Text = "FOV Radius", Min = 0, Max = 500, Default = 150, Callback = function(v) getgenv().Config.FOV = v end})
MainGroup:AddToggle("ShowFOV", {Text = "Show FOV Circle", Default = true, Callback = function(v) getgenv().Config.ShowFOV = v end})

local EspGroup = EspTab:AddLeftGroupbox("Main")
EspGroup:AddToggle("EspEnabled", {Text = "Enabled", Default = true, Callback = function(v) ESP.Enabled = v end})
EspGroup:AddSlider("MaxDist", {Text = "Max Distance", Min = 0, Max = 2000, Default = 400, Callback = function(v) ESP.MaxDistance = v end})

local SettingsGroup = SettingsTab:AddLeftGroupbox("Menu")
SettingsGroup:AddLabel("Discord: Bo.xd")
SettingsGroup:AddKeybind("MenuToggle", {Text = "Menu Toggle", Default = "RightShift", Callback = function(v) getgenv().Config.MenuKeybind = v end})

local UiVisible = true
UserInputService.InputBegan:Connect(function(input, gp)
    if not gp and input.KeyCode == getgenv().Config.MenuKeybind then
        UiVisible = not UiVisible
        Win:SetVisible(UiVisible)
    end
end)

ESP.Enabled = true
ESP.BoxColor = Color3.fromRGB(255, 0, 0)
SyncESP()

Library:Notify("BHub Remastered | Rivals Loaded", 5)

RunService.RenderStepped:Connect(function()
    local MousePos = UserInputService:GetMouseLocation()
    FovCircle.Position = MousePos
    FovCircle.Radius = getgenv().Config.FOV
    FovCircle.Visible = getgenv().Config.Enabled and getgenv().Config.ShowFOV
    
    CurrentTarget = GetClosest()
    if CurrentTarget then
        local Camera = Workspace.CurrentCamera
        local pos, onScreen = Camera:WorldToViewportPoint(CurrentTarget.Position)
        TargetTracer.From = MousePos
        TargetTracer.To = Vector2.new(pos.X, pos.Y)
        TargetTracer.Visible = getgenv().Config.Enabled
    else
        TargetTracer.Visible = false
    end
end)
[🎉] RIVALS Bo's pro Silent aim
853views
6 months ago

Bo's pro Silent aim

Author
User Avatar
Boo
Status
Working
Price
Free

Description

full ui is with drawing api (if ur executor doesnt support this script wont work)

Features

2
  • Silent aim
  • esp

Related Scripts