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)full ui is with drawing api (if ur executor doesnt support this script wont work)
No comments yet. Be the first to comment!
1local Players = game:GetService("Players")
2local Workspace = game:GetService("Workspace")
3local UserInputService = game:GetService("UserInputService")
4local RunService = game:GetService("RunService")
5local ReplicatedStorage = game:GetService("ReplicatedStorage")
6local LocalPlayer = Players.LocalPlayer
7
8getgenv().Config = {
9 Enabled = true,
10 Players = false,
11 FOV = 150,
12 ShowFOV = true,
13 DummyTargets = {"dummy", "DPS dummy"},
14 StickyBonus = 0.8,
15 VisibilityCheck = true,
16 MenuKeybind = Enum.KeyCode.RightShift
17}
18
19local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/bo-xd/Bhub-remastered/refs/heads/main/src/util/ui/DrawingUILib.lua"))()
20local ESP = loadstring(game:HttpGet("https://raw.githubusercontent.com/bo-xd/Bhub-remastered/refs/heads/main/src/util/Esp.lua"))()
21
22local FovCircle = Drawing.new("Circle")
23FovCircle.Thickness = 1
24FovCircle.NumSides = 64
25FovCircle.Radius = getgenv().Config.FOV
26FovCircle.Color = Color3.new(1, 1, 1)
27FovCircle.Visible = getgenv().Config.ShowFOV
28
29local TargetTracer = Drawing.new("Line")
30TargetTracer.Thickness = 1
31TargetTracer.Color = Color3.fromRGB(255, 0, 0)
32TargetTracer.Visible = false
33
34local CurrentTarget = nil
35
36local function IsVisible(part)
37 local Camera = Workspace.CurrentCamera
38 if not Camera then return false end
39 local params = RaycastParams.new()
40 params.FilterType = Enum.RaycastFilterType.Exclude
41 params.FilterDescendantsInstances = {LocalPlayer.Character, part.Parent, Workspace:FindFirstChild("ViewModels")}
42 local result = Workspace:Raycast(Camera.CFrame.Position, (part.Position - Camera.CFrame.Position), params)
43 return result == nil
44end
45
46local function GetClosest()
47 if not getgenv().Config.Enabled then return nil end
48 local Camera = Workspace.CurrentCamera
49 if not Camera then return nil end
50 local MousePos = UserInputService:GetMouseLocation()
51 local Closest, BestDist = nil, getgenv().Config.FOV
52
53 if CurrentTarget and CurrentTarget.Parent then
54 local pos, onScreen = Camera:WorldToViewportPoint(CurrentTarget.Position)
55 if onScreen then
56 local dist = (Vector2.new(pos.X, pos.Y) - MousePos).Magnitude
57 if dist < getgenv().Config.FOV * 1.2 and (not getgenv().Config.VisibilityCheck or IsVisible(CurrentTarget)) then
58 Closest, BestDist = CurrentTarget, dist * getgenv().Config.StickyBonus
59 end
60 end
61 end
62
63 local function checkEntity(entity)
64 local Part = entity:IsA("Model") and (entity:FindFirstChild("Head") or entity:FindFirstChild("HumanoidRootPart") or entity.PrimaryPart) or (entity:IsA("BasePart") and entity)
65 if Part and Part ~= CurrentTarget then
66 local pos, onScreen = Camera:WorldToViewportPoint(Part.Position)
67 if onScreen then
68 local dist = (Vector2.new(pos.X, pos.Y) - MousePos).Magnitude
69 if dist < BestDist and (not getgenv().Config.VisibilityCheck or IsVisible(Part)) then
70 Closest, BestDist = Part, dist
71 end
72 end
73 end
74 end
75
76 if getgenv().Config.Players then
77 for _, p in pairs(Players:GetPlayers()) do
78 if p ~= LocalPlayer and p.Character and p.Character:FindFirstChild("Humanoid") and p.Character.Humanoid.Health > 0 then
79 checkEntity(p.Character)
80 end
81 end
82 else
83 local Entities = Workspace:FindFirstChild("ShootingRangeEntities")
84 if Entities then
85 for _, Entity in pairs(Entities:GetChildren()) do
86 local name = Entity.Name:lower()
87 local isValid = false
88 for _, t in pairs(getgenv().Config.DummyTargets) do if name:find(t:lower()) then isValid = true break end end
89 if isValid then checkEntity(Entity) end
90 end
91 end
92 end
93 return Closest
94end
95
96local oldNamecall
97oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(self, ...)
98 local method = getnamecallmethod()
99 local args = {...}
100 if not checkcaller() and self == Workspace and (method == "Raycast" or method == "raycast") and CurrentTarget then
101 local origin = args[1]
102 local direction = args[2]
103 if typeof(origin) == "Vector3" and typeof(direction) == "Vector3" and direction.Magnitude > 50 then
104 args[2] = (CurrentTarget.Position - origin).Unit * direction.Magnitude
105 return oldNamecall(self, unpack(args))
106 end
107 end
108 return oldNamecall(self, ...)
109end))
110
111local oldNewIndex
112oldNewIndex = hookmetamethod(game, "__newindex", function(self, index, value)
113 if not checkcaller() then
114 return oldNewIndex(self, index, value)
115 end
116 if value == game then
117 return nil
118 end
119 return oldNewIndex(self, index, value)
120end)
121
122local function SyncESP()
123 ESP:Clear()
124 if getgenv().Config.Players then
125 local function setupPlayer(p)
126 if p == LocalPlayer then return end
127 p.CharacterAdded:Connect(function(char)
128 if getgenv().Config.Players then
129 char:WaitForChild("HumanoidRootPart", 5)
130 ESP:Add(char, {Name = p.Name, Color = ESP.BoxColor})
131 end
132 end)
133 if p.Character then ESP:Add(p.Character, {Name = p.Name, Color = ESP.BoxColor}) end
134 end
135 Players.PlayerAdded:Connect(setupPlayer)
136 for _, p in pairs(Players:GetPlayers()) do setupPlayer(p) end
137 else
138 local Entities = Workspace:FindFirstChild("ShootingRangeEntities")
139 if Entities then
140 local function add(child)
141 local name = child.Name:lower()
142 local isValid = false
143 for _, t in pairs(getgenv().Config.DummyTargets) do if name:find(t:lower()) then isValid = true break end end
144 if isValid then ESP:Add(child, {Name = child.Name, Color = ESP.BoxColor}) end
145 end
146 Entities.ChildAdded:Connect(function(c) if not Config.Players then add(c) end end)
147 for _, child in pairs(Entities:GetChildren()) do add(child) end
148 end
149 end
150end
151
152local Win = Library:CreateWindow({Title = "BHub Remastered | Rivals"})
153local CombatTab = Win:AddTab("Combat")
154local EspTab = Win:AddTab("ESP")
155local SettingsTab = Win:AddTab("Settings")
156
157local MainGroup = CombatTab:AddLeftGroupbox("Main")
158MainGroup:AddToggle("Enabled", {Text = "Aimbot Enabled", Default = true, Callback = function(v) getgenv().Config.Enabled = v end})
159MainGroup:AddToggle("Players", {Text = "Target Players", Default = false, Callback = function(v) getgenv().Config.Players = v; SyncESP() end})
160MainGroup:AddToggle("Visibility", {Text = "Visibility Check", Default = true, Callback = function(v) getgenv().Config.VisibilityCheck = v end})
161MainGroup:AddSlider("FOV", {Text = "FOV Radius", Min = 0, Max = 500, Default = 150, Callback = function(v) getgenv().Config.FOV = v end})
162MainGroup:AddToggle("ShowFOV", {Text = "Show FOV Circle", Default = true, Callback = function(v) getgenv().Config.ShowFOV = v end})
163
164local EspGroup = EspTab:AddLeftGroupbox("Main")
165EspGroup:AddToggle("EspEnabled", {Text = "Enabled", Default = true, Callback = function(v) ESP.Enabled = v end})
166EspGroup:AddSlider("MaxDist", {Text = "Max Distance", Min = 0, Max = 2000, Default = 400, Callback = function(v) ESP.MaxDistance = v end})
167
168local SettingsGroup = SettingsTab:AddLeftGroupbox("Menu")
169SettingsGroup:AddLabel("Discord: Bo.xd")
170SettingsGroup:AddKeybind("MenuToggle", {Text = "Menu Toggle", Default = "RightShift", Callback = function(v) getgenv().Config.MenuKeybind = v end})
171
172local UiVisible = true
173UserInputService.InputBegan:Connect(function(input, gp)
174 if not gp and input.KeyCode == getgenv().Config.MenuKeybind then
175 UiVisible = not UiVisible
176 Win:SetVisible(UiVisible)
177 end
178end)
179
180ESP.Enabled = true
181ESP.BoxColor = Color3.fromRGB(255, 0, 0)
182SyncESP()
183
184Library:Notify("BHub Remastered | Rivals Loaded", 5)
185
186RunService.RenderStepped:Connect(function()
187 local MousePos = UserInputService:GetMouseLocation()
188 FovCircle.Position = MousePos
189 FovCircle.Radius = getgenv().Config.FOV
190 FovCircle.Visible = getgenv().Config.Enabled and getgenv().Config.ShowFOV
191
192 CurrentTarget = GetClosest()
193 if CurrentTarget then
194 local Camera = Workspace.CurrentCamera
195 local pos, onScreen = Camera:WorldToViewportPoint(CurrentTarget.Position)
196 TargetTracer.From = MousePos
197 TargetTracer.To = Vector2.new(pos.X, pos.Y)
198 TargetTracer.Visible = getgenv().Config.Enabled
199 else
200 TargetTracer.Visible = false
201 end
202end)