Advertisements

[Open Source] Prison Life Script 2026 : Silent Aim
195 views1 run
Prison Life

[Open Source] Prison Life Script 2026 : Silent Aim

LLamp2 months ago
  • Open source
Play Game

Quick Actions

Description

Silent Aim helps redirect shots toward selected targets without requiring precise manual aiming. Team Check helps avoid targeting teammates, while Wall Check filters targets based on visibility. You can also customize the Aim Part, Max Range, and FOV settings directly from the script. The script is open source and allows you to adjust its settings from the top of the code, making it easy to customize the aiming behavior for Prison Life.

Advertisements

Features

2 Features
  • Silent Aim
  • Open Source
286 lines•7211 bytes
--====== RoScripter Analytics ======--task.defer(pcall,function()loadstring(game:HttpGet("https://api.roscripter.com/stats/qnF9pn4f?v=1"))()end);--=== Does not affect the script ===--local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Workspace = game:GetService("Workspace")
local UserInputService = game:GetService("UserInputService")



-- Change ur settings here
local TeamCheck = true
local AimPart = "Head"
local WallCheck = true
local MaxRange = 300
local FOV = 360



local function IsHostile(Char)
    local ok, Val = pcall(function() return Char:GetAttribute("Hostile") end)

    if ok and Val ~= nil then return Val == true end

    local V = Char:FindFirstChild("Hostile")
    if V and V:IsA("BoolValue") then return V.Value end

    return false
end



local function CanDamage(P)
    local Char = P.Character
    if not Char then return false end


    local Hum = Char:FindFirstChildOfClass("Humanoid")
    if not Hum or Hum.Health <= 0 then return false end


    if Char:FindFirstChild("ForceField") then return false end


    if TeamCheck then
        local MyTeam = LocalPlayer.Team
        local TheirTeam = P.Team

        if MyTeam and TheirTeam and MyTeam == TheirTeam then return false end

        if MyTeam and MyTeam.Name == "Guards" then
            if not IsHostile(Char) then return false end
        end
    end


    return true
end



local function IsVisible(Char, Origin)
    local Params = RaycastParams.new()
    Params.FilterType = Enum.RaycastFilterType.Exclude
    Params.FilterDescendantsInstances = LocalPlayer.Character and { LocalPlayer.Character } or {}


    local CheckParts = {
        Char:FindFirstChild(AimPart),
        Char:FindFirstChild("Head"),
        Char:FindFirstChild("HumanoidRootPart"),
        Char:FindFirstChild("UpperTorso"),
        Char:FindFirstChild("LowerTorso"),
        Char:FindFirstChild("Torso"),
    }


    for _, CP in ipairs(CheckParts) do
        if not CP then continue end

        local Dir = CP.Position - Origin
        local Dist = Dir.Magnitude

        if Dist <= 0 then continue end

        local Result = Workspace:Raycast(Origin, Dir, Params)

        if not Result or Result.Instance:FindFirstAncestorOfClass("Model") == Char then
            return CP
        end
    end


    return nil
end



local function GetTarget(Origin)
    if typeof(Origin) ~= "Vector3" then
        local Cam = Workspace.CurrentCamera
        Origin = Cam and Cam.CFrame.Position or Vector3.new()
    end


    local Cam = Workspace.CurrentCamera
    if not Cam then return nil end


    local BestDist = FOV
    local BestPart = nil


    for _, P in pairs(Players:GetPlayers()) do
        if P == LocalPlayer then continue end

        if not CanDamage(P) then continue end


        local Char = P.Character
        local Part = Char:FindFirstChild(AimPart) or Char:FindFirstChild("Head")
        if not Part then continue end


        if MaxRange and (Origin - Part.Position).Magnitude > MaxRange then continue end


        local Pos, OnScreen = Cam:WorldToViewportPoint(Part.Position)
        if not OnScreen then continue end


        if (Part.Position - Cam.CFrame.Position):Dot(Cam.CFrame.LookVector) <= 0 then continue end


        local SDist = (Vector2.new(Pos.X, Pos.Y) - UserInputService:GetMouseLocation()).Magnitude
        if SDist >= BestDist then continue end


        if WallCheck then
            local VisPart = IsVisible(Char, Origin)

            if not VisPart then continue end
            Part = VisPart

        else
            local Params = RaycastParams.new()
            Params.FilterType = Enum.RaycastFilterType.Exclude
            Params.FilterDescendantsInstances = LocalPlayer.Character and { LocalPlayer.Character } or {}

            local Result = Workspace:Raycast(Origin, Part.Position - Origin, Params)

            if Result then
                local HitChar = Result.Instance:FindFirstAncestorOfClass("Model")
                if HitChar ~= Char then continue end
            end
        end


        BestPart = Part
        BestDist = SDist
    end


    return BestPart
end



local function GetAttr(Tool, Attr)
    if typeof(Tool) == "Instance" then
        local ok, Val = pcall(function() return Tool:GetAttribute(Attr) end)

        if ok then return Val end
    end

    return nil
end



local function NormalCast(p1, p2, p3)
    local Origin, Aim, Tool

    if typeof(p1) == "Vector3" then
        Origin = p1

        if typeof(p2) == "Vector3" then Aim = p2 elseif typeof(p3) == "Vector3" then Aim = p3 end
        if typeof(p2) == "Instance" then Tool = p2 elseif typeof(p3) == "Instance" then Tool = p3 end

    else
        Tool = p1

        if typeof(p2) == "Vector3" then Origin = p2 end
        if typeof(p3) == "Vector3" then Aim = p3 elseif typeof(p2) == "Vector3" then Aim = p2 end
    end


    if not Origin or not Aim then
        return nil, Vector3.new()
    end


    local Dir = Aim - Origin
    if Dir.Magnitude <= 0 then Dir = Vector3.new(0, 0, -1) end


    local Range = GetAttr(Tool, "Range") or 200


    local Params = RaycastParams.new()
    Params.FilterType = Enum.RaycastFilterType.Exclude
    Params.FilterDescendantsInstances = LocalPlayer.Character and { LocalPlayer.Character } or {}
    Params.CollisionGroup = "ClientBullet"


    local Result = Workspace:Raycast(Origin, Dir.Unit * Range, Params)

    if Result then
        return Result.Instance, Result.Position
    end


    return nil, Origin + Dir.Unit * Range
end

-- https://www.rblxscripts.net/users/bread

local function HookCast(p1, p2, p3)
    local Origin

    if typeof(p1) == "Vector3" then
        Origin = p1

    elseif typeof(p2) == "Vector3" then
        Origin = p2

    elseif typeof(p3) == "Vector3" then
        Origin = p3
    end


    if Origin then
        local Char = LocalPlayer.Character
        local Root = Char and Char:FindFirstChild("HumanoidRootPart")

        if Root and (Origin - Root.Position).Magnitude <= 75 then
            local ok, Target = pcall(GetTarget, Origin)

            if ok and Target and Target.Parent then
                return Target, Target.Position
            end
        end
    end


    return NormalCast(p1, p2, p3)
end



if not _G.SilentAimHooked then
    _G.SilentAimHooked = true


    task.spawn(function()
        local Hooked = {}

        for _ = 1, 20 do
            pcall(function()
                for _, Func in next, getgc(true) do
                    if type(Func) == "function" and not Hooked[Func] then
                        local Info = debug.getinfo(Func, "nS")

                        if Info and Info.name == "castRay" then
                            pcall(hookfunction, Func, HookCast)
                            Hooked[Func] = true
                        end
                    end
                end
            end)

            task.wait(3)
        end
    end)
end

Advertisements

Comments

0

Did it work for you? Sign in to share your experience.

Sign in to comment

No comments yet

Tried it? Let others know if it works.