Skip to content
RoRoScripts
silent aim open source preview
Unknown

silent aim open source

Script
Views
1.8K
Likes
1
Dislikes
1
Added
Script
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer
local targetPos = nil
local function getClosestTarget()
    local camera = workspace.CurrentCamera
    local mousePos = UserInputService:GetMouseLocation()
    local closestDist = math.huge
    local closestPos = nil
    for _, player in ipairs(Players:GetPlayers()) do
        if player == LocalPlayer then continue end
        local char = player.Character
        if not char then continue end
        local head = char:FindFirstChild("Head")
        if not head then continue end
        local screenPos, onScreen = camera:WorldToViewportPoint(head.Position)
        if not onScreen then continue end
        local dist = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude
        if dist < closestDist then
            closestDist = dist
            closestPos = head.Position
        end
    end
    targetPos = closestPos
end
local oldNamecall
oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(self, ...)
    local method = getnamecallmethod():lower()
    if method == "raycast" and targetPos and typeof(self) == "Instance" and self == workspace then
        local args = {...}
        if typeof(args[1]) == "Vector3" then
            local camera = workspace.CurrentCamera
            args[2] = (targetPos - camera.CFrame.Position).Unit * 500
            return oldNamecall(self, table.unpack(args))
        end
    end
    return oldNamecall(self, ...)
end))
RunService.Heartbeat:Connect(getClosestTarget)

Features

  • Credits: Phemonaz