Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Dahood games
- local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
- local Window = Rayfield:CreateWindow({
- Name = "Capybara Hub | Dahood Games",
- Icon = 0,
- LoadingTitle = "Open source, Safe, Free, Undetected",
- LoadingSubtitle = "by Wesd",
- ShowText = "Capybara hub",
- Theme = "Default",
- ToggleUIKeybind = "K",
- ConfigurationSaving = {
- Enabled = true,
- FolderName = nil,
- FileName = "CapybaraHub_DahoodGames"
- }
- })
- local Tab = Window:CreateTab("Main", 4483362458)
- local PriorityTab = Window:CreateTab("Target Priority", 4483362458)
- -- Silent Aim Settings
- local SilentAimEnabled = false
- local PredictionEnabled = false
- local PredictionAmount = 0.15
- local FOVRadius = 100
- local FOVCircleVisible = true
- local FOVCircleColor = Color3.fromRGB(255, 255, 255)
- local FOVCircleThickness = 1.5
- -- Priority Settings
- local IgnoreDead = true
- local DeadHPThreshold = 0
- local IgnoreTeam = false
- local WallPriority = false
- local PriorityMode = "Closest to Crosshair"
- -- Target Bind
- local TargetBindKey = Enum.KeyCode.T
- local LockedTarget = nil
- local TargetBindActive = false
- -- Mouse, Camera
- local mouse = game.Players.LocalPlayer:GetMouse()
- local camera = workspace.CurrentCamera
- -- Create FOV Circle
- local fovCircle = Drawing.new("Circle")
- fovCircle.Radius = FOVRadius
- fovCircle.Color = FOVCircleColor
- fovCircle.Thickness = FOVCircleThickness
- fovCircle.Transparency = 1
- fovCircle.Filled = false
- -- Highlight Instance
- local currentHighlight = nil
- -- Update FOV Circle
- task.spawn(function()
- while task.wait() do
- fovCircle.Visible = FOVCircleVisible
- fovCircle.Position = Vector2.new(mouse.X, mouse.Y + game:GetService("GuiService"):GetGuiInset().Y)
- fovCircle.Radius = FOVRadius
- fovCircle.Color = FOVCircleColor
- fovCircle.Thickness = FOVCircleThickness
- end
- end)
- -- Check if Player is Behind Wall
- local function IsBehindWall(char)
- local hrp = char:FindFirstChild("HumanoidRootPart")
- if not hrp then return true end
- local ray = Ray.new(camera.CFrame.Position, (hrp.Position - camera.CFrame.Position).Unit * (hrp.Position - camera.CFrame.Position).Magnitude)
- local hitPart = workspace:FindPartOnRayWithIgnoreList(ray, {game.Players.LocalPlayer.Character})
- return hitPart and hitPart:IsDescendantOf(char) == false
- end
- -- Apply Highlight
- local function HighlightTarget(player)
- if currentHighlight then
- currentHighlight:Destroy()
- currentHighlight = nil
- end
- if player and player.Character then
- local highlight = Instance.new("Highlight")
- highlight.Adornee = player.Character
- highlight.FillColor = Color3.fromRGB(255, 0, 0)
- highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
- highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- highlight.Parent = player.Character
- currentHighlight = highlight
- end
- end
- -- Get Target
- local function GetTarget()
- if TargetBindActive and LockedTarget and LockedTarget.Character then
- return LockedTarget
- end
- local candidates = {}
- local visibleCandidates = {}
- for _, player in pairs(game.Players:GetPlayers()) do
- if player ~= game.Players.LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
- local humanoid = player.Character:FindFirstChild("Humanoid")
- if humanoid then
- if IgnoreDead and humanoid.Health <= DeadHPThreshold then
- continue
- end
- if IgnoreTeam and player.Team == game.Players.LocalPlayer.Team then
- continue
- end
- local pos, onScreen = camera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
- if onScreen then
- local mag = (Vector2.new(mouse.X, mouse.Y) - Vector2.new(pos.X, pos.Y)).Magnitude
- if mag <= FOVRadius then
- local behindWall = IsBehindWall(player.Character)
- table.insert(candidates, {Player = player, Mag = mag, HP = humanoid.Health, Wall = behindWall})
- if not behindWall then
- table.insert(visibleCandidates, {Player = player, Mag = mag, HP = humanoid.Health, Wall = behindWall})
- end
- end
- end
- end
- end
- end
- local listToUse = (WallPriority and #visibleCandidates > 0) and visibleCandidates or candidates
- if #listToUse == 0 then return nil end
- if PriorityMode == "Closest to Crosshair" then
- table.sort(listToUse, function(a, b) return a.Mag < b.Mag end)
- elseif PriorityMode == "Lowest HP" then
- table.sort(listToUse, function(a, b) return a.HP < b.HP end)
- elseif PriorityMode == "Highest HP" then
- table.sort(listToUse, function(a, b) return a.HP > b.HP end)
- end
- return listToUse[1].Player
- end
- -- Keybind Handling
- game:GetService("UserInputService").InputBegan:Connect(function(input, gpe)
- if gpe then return end
- if input.KeyCode == TargetBindKey then
- if not TargetBindActive then
- local potentialTarget = GetTarget()
- if potentialTarget then
- LockedTarget = potentialTarget
- TargetBindActive = true
- end
- else
- LockedTarget = nil
- TargetBindActive = false
- end
- end
- end)
- -- Silent Aim Loop
- task.spawn(function()
- while task.wait() do
- if SilentAimEnabled then
- local target = GetTarget()
- HighlightTarget(target)
- if target then
- local hrp = target.Character and target.Character:FindFirstChild("HumanoidRootPart")
- if hrp then
- local coords = hrp.Position
- if PredictionEnabled then
- coords = coords + (hrp.Velocity * PredictionAmount)
- end
- game:GetService("ReplicatedStorage"):WaitForChild("MAINEVENT"):FireServer("MOUSE", coords)
- end
- end
- else
- HighlightTarget(nil)
- end
- end
- end)
- -- UI Controls
- Tab:CreateToggle({
- Name = "Enable Silent Aim",
- CurrentValue = false,
- Callback = function(val) SilentAimEnabled = val end
- })
- Tab:CreateToggle({
- Name = "Enable Prediction",
- CurrentValue = false,
- Callback = function(val) PredictionEnabled = val end
- })
- Tab:CreateSlider({
- Name = "Prediction Amount",
- Range = {0, 1},
- Increment = 0.01,
- Suffix = "s",
- CurrentValue = PredictionAmount,
- Callback = function(val) PredictionAmount = val end
- })
- Tab:CreateToggle({
- Name = "Show FOV Circle",
- CurrentValue = true,
- Callback = function(val) FOVCircleVisible = val end
- })
- Tab:CreateSlider({
- Name = "FOV Radius",
- Range = {50, 500},
- Increment = 1,
- Suffix = "px",
- CurrentValue = FOVRadius,
- Callback = function(val) FOVRadius = val end
- })
- PriorityTab:CreateToggle({
- Name = "Ignore Dead Players",
- CurrentValue = true,
- Callback = function(val) IgnoreDead = val end
- })
- PriorityTab:CreateSlider({
- Name = "Dead HP Threshold",
- Range = {0, 100},
- Increment = 1,
- Suffix = "hp",
- CurrentValue = DeadHPThreshold,
- Callback = function(val) DeadHPThreshold = val end
- })
- PriorityTab:CreateToggle({
- Name = "Ignore Teammates",
- CurrentValue = false,
- Callback = function(val) IgnoreTeam = val end
- })
- PriorityTab:CreateToggle({
- Name = "Wall Priority",
- CurrentValue = false,
- Callback = function(val) WallPriority = val end
- })
- PriorityTab:CreateDropdown({
- Name = "Priority Mode",
- Options = {"Closest to Crosshair", "Lowest HP", "Highest HP"},
- CurrentOption = {PriorityMode},
- Callback = function(opt) PriorityMode = opt[1] end
- })
- PriorityTab:CreateLabel("Target Bind Key: T (toggle lock on current target)")
- Tab:CreateButton({
- Name = "Unload Script",
- Callback = function()
- if currentHighlight then currentHighlight:Destroy() end
- fovCircle:Remove()
- Rayfield:Destroy()
- script:Destroy()
- end
- })
Advertisement