--// Silent Aim (Raycast Only) - Core
if not game:IsLoaded() then game.Loaded:Wait() end

local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local Camera = Workspace.CurrentCamera
local UserInputService = game:GetService("UserInputService")

local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()

local Settings = {
    Enabled = true,
    TeamCheck = false,
    VisibleCheck = false,
    TargetPart = "HumanoidRootPart",
    FOVRadius = 130,
    HitChance = 100
}

local function getMousePosition()
    return UserInputService:GetMouseLocation()
end

local function CalculateChance(percentage)
    return math.random(0, 100) <= percentage
end

local function IsPlayerVisible(Player, targetPartName)
    local character = Player and Player.Character
    local localChar = LocalPlayer.Character
    if not character or not localChar then return false end

    local target = character:FindFirstChild(targetPartName) or character:FindFirstChild("HumanoidRootPart")
    if not target then return false end

    local parts = Camera:GetPartsObscuringTarget({target.Position}, {localChar, character})
    return #parts == 0
end

local function getClosestPlayer()
    local best, bestDist
    local mousePos = getMousePosition()

    for _, pl in ipairs(Players:GetPlayers()) do
        if pl == LocalPlayer then continue end
        if Settings.TeamCheck and pl.Team == LocalPlayer.Team then continue end
        if not pl.Character then continue end

        local humanoid = pl.Character:FindFirstChildOfClass("Humanoid")
        if not humanoid or humanoid.Health <= 0 then continue end

        if Settings.VisibleCheck and not IsPlayerVisible(pl, Settings.TargetPart) then continue end

        local part = pl.Character:FindFirstChild(Settings.TargetPart)
        if not part then continue end

        local screenPos, onScreen = Camera:WorldToViewportPoint(part.Position)
        if not onScreen then continue end

        local dist = (Vector2.new(screenPos.X, screenPos.Y) - Vector2.new(mousePos.X, mousePos.Y)).Magnitude
        if dist <= Settings.FOVRadius and (not bestDist or dist < bestDist) then
            best = part
            bestDist = dist
        end
    end

    return best
end

--// Hook Raycast
local mt = getrawmetatable(game)
local oldNamecall = mt.__namecall
setreadonly(mt, false)

mt.__namecall = function(self, ...)
    local method = getnamecallmethod()
    local args = {...}

    if Settings.Enabled and method == "Raycast" and self == Workspace then
        if CalculateChance(Settings.HitChance) then
            local targetPart = getClosestPlayer()
            if targetPart then
                local origin = args[1]
                local dir = (targetPart.Position - origin).Unit * (args[2].Magnitude)
                args[2] = dir
                return oldNamecall(self, unpack(args))
            end
        end
    end

    return oldNamecall(self, ...)
end

setreadonly(mt, true)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: