simple prison life script
Key RequiredUniversal

simple prison life script

Universal Scriptracksznrackszn 2.7K views 638 executesUpdated Dec 30, 2025
5.0/ 5(3 votes)
30100% Positive
Lua Script•906 lines (29218 chars)
-- Combined ESP and Aimbot Script for Roblox
-- ESP with team colors + Aimbot with teleport
-- Written in pure Luau

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local localPlayer = Players.LocalPlayer
local camera = workspace.CurrentCamera

-- Type definitions for better Luau performance
type ESPObject = {
    player: Player,
    boxes: {Drawing.Line}?,
    nameLabel: Drawing.Text?,
    tracer: Drawing.Line?,
    billboard: BillboardGui?,
    highlight: SelectionBox?
}

-- Check if Drawing API is available
local DrawingAPI = (Drawing :: any) ~= nil
local espObjects: {[Player]: ESPObject} = {}

-- ESP Configuration
local ESP_ENABLED = true
local SHOW_BOXES = true
local SHOW_NAMES = true
local SHOW_TRACER = false
local TEAM_CHECK = false

-- Team Colors Configuration
local TEAM_COLORS = {
    -- Default colors for teams without specific colors
    default = {
        box = Color3.fromRGB(255, 0, 0),
        text = Color3.fromRGB(255, 255, 255)
    },
    -- Team-specific colors
    ["Guards"] = {
        box = Color3.fromRGB(0, 100, 255),  -- Blue for cops
        text = Color3.fromRGB(200, 200, 255)
    },
    ["Police"] = {
        box = Color3.fromRGB(0, 100, 255),  -- Blue for cops
        text = Color3.fromRGB(200, 200, 255)
    },
    ["Cops"] = {
        box = Color3.fromRGB(0, 100, 255),  -- Blue for cops
        text = Color3.fromRGB(200, 200, 255)
    },
    ["Criminals"] = {
        box = Color3.fromRGB(255, 0, 0),    -- Red for criminals
        text = Color3.fromRGB(255, 150, 150)
    },
    ["Prisoners"] = {
        box = Color3.fromRGB(255, 165, 0),  -- Orange for prisoners
        text = Color3.fromRGB(255, 200, 150)
    },
    ["Inmates"] = {
        box = Color3.fromRGB(255, 165, 0),  -- Orange for prisoners
        text = Color3.fromRGB(255, 200, 150)
    },
    ["Neutral"] = {
        box = Color3.fromRGB(128, 128, 128), -- Gray for neutral
        text = Color3.fromRGB(200, 200, 200)
    }
}

-- Aimbot Configuration
local AIMBOT_ENABLED = false
local AIM_SMOOTHNESS = 1 -- Instant lock-on (no smoothing)
local AIM_BONE = "Head"
local HIGHLIGHT_COLOR = Color3.fromRGB(128, 0, 128) -- Purple
local HIGHLIGHT_TRANSPARENCY = 0.3
local HIGHLIGHT_FILL_COLOR = Color3.fromRGB(128, 0, 128)
local HIGHLIGHT_FILL_TRANSPARENCY = 0.7

-- GUI Variables
local screenGui: ScreenGui?
local espToggleButton: TextButton?
local creditsLabel: TextLabel?
local keybindListLabel: TextLabel?
local guiVisible = true

-- Aimbot Variables
local targetPlayer: Player? = nil
local targetHighlight: SelectionBox? = nil
local targetFill: Highlight? = nil
local aimConnection: RBXScriptConnection? = nil
local isLocked = false
local notificationGui: ScreenGui? = nil
local notificationLabel: TextLabel? = nil

if not DrawingAPI then
    warn("Drawing API not available, using BillboardGui method")
end

-- Function to get team colors
local function getTeamColors(player: Player): {box: Color3, text: Color3}
    local teamName = player.Team and player.Team.Name or "Neutral"
    return TEAM_COLORS[teamName] or TEAM_COLORS.default
end

-- Function to create drawing object (if Drawing API is available)
local function createDrawing(class: string, properties: {[string]: any}): any?
    if not DrawingAPI then
        return nil
    end
    
    local success, drawing = pcall(function()
        local draw = Drawing.new(class)
        for property, value in pairs(properties) do
            if (draw :: any)[property] ~= nil then
                (draw :: any)[property] = value
            end
        end
        return draw
    end)
    
    return success and drawing or nil
end

-- Function to create notification GUI
local function createNotificationGUI(): ()
    if notificationGui then return end
    
    notificationGui = Instance.new("ScreenGui")
    notificationGui.Name = "CombinedNotification"
    notificationGui.ResetOnSpawn = false
    notificationGui.Parent = game:GetService("CoreGui") or localPlayer:WaitForChild("PlayerGui")
    
    notificationLabel = Instance.new("TextLabel")
    notificationLabel.Name = "NotificationLabel"
    notificationLabel.Size = UDim2.new(0, 300, 0, 50)
    notificationLabel.Position = UDim2.new(0.5, -150, 0.15, 0)
    notificationLabel.BackgroundTransparency = 0.2
    notificationLabel.BackgroundColor3 = Color3.fromRGB(128, 0, 128)
    notificationLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    notificationLabel.TextScaled = true
    notificationLabel.Font = Enum.Font.GothamBold
    notificationLabel.Visible = false
    notificationLabel.Parent = notificationGui
    
    local corner = Instance.new("UICorner")
    corner.CornerRadius = UDim.new(0, 10)
    corner.Parent = notificationLabel
end

-- Function to show notification
local function showNotification(text: string): ()
    if not notificationLabel then
        createNotificationGUI()
    end
    
    if notificationLabel then
        notificationLabel.Text = text
        notificationLabel.Visible = true
        
        -- Animate in
        local tweenIn = TweenService:Create(notificationLabel, 
            TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
            {Position = UDim2.new(0.5, -150, 0.15, 20)}
        )
        tweenIn:Play()
        
        -- Animate out after 2 seconds
        task.spawn(function()
            task.wait(2)
            if notificationLabel then
                local tweenOut = TweenService:Create(notificationLabel, 
                    TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.In),
                    {Position = UDim2.new(0.5, -150, 0.15, 0)}
                )
                tweenOut:Play()
                tweenOut.Completed:Connect(function()
                    if notificationLabel then
                        notificationLabel.Visible = false
                    end
                end)
            end
        end)
    end
end

-- Alternative: Create BillboardGui ESP (works without Drawing API)
local function createBillboardESP(player: Player): ()
    if player == localPlayer then return end
    
    local character = player.Character or player.CharacterAdded:Wait()
    local humanoidRootPart = character:WaitForChild("HumanoidRootPart", 10) :: Part?
    
    if not humanoidRootPart then return end
    
    local teamColors = getTeamColors(player)
    
    -- Create BillboardGui for name
    local billboard = Instance.new("BillboardGui")
    billboard.Name = "ESP"
    billboard.Size = UDim2.new(0, 200, 0, 50)
    billboard.StudsOffset = Vector3.new(0, 3, 0)
    billboard.AlwaysOnTop = true
    billboard.Adornee = humanoidRootPart
    billboard.Parent = humanoidRootPart
    
    local nameLabel = Instance.new("TextLabel")
    nameLabel.Size = UDim2.new(1, 0, 1, 0)
    nameLabel.BackgroundTransparency = 1
    nameLabel.Text = player.Name .. (player.Team and " [" .. player.Team.Name .. "]" or "")
    nameLabel.TextColor3 = teamColors.text
    nameLabel.TextScaled = true
    nameLabel.Font = Enum.Font.GothamBold
    nameLabel.TextStrokeTransparency = 0.5
    nameLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
    nameLabel.Parent = billboard
    
    -- Create highlight for box effect
    local highlight = Instance.new("SelectionBox")
    highlight.Adornee = character
    highlight.Transparency = 0.5
    highlight.Color3 = teamColors.box
    highlight.LineThickness = 0.1
    highlight.Parent = character
    
    espObjects[player] = {
        billboard = billboard,
        highlight = highlight,
        player = player
    }
end

-- GUI Creation Functions (Pure Luau)
local function createGUI(): ()
    -- Create ScreenGui
    screenGui = Instance.new("ScreenGui")
    screenGui.Name = "Combined_GUI"
    screenGui.ResetOnSpawn = false
    screenGui.Parent = game:GetService("CoreGui") or localPlayer:WaitForChild("PlayerGui")
    
    -- Credits Label (Top of screen)
    creditsLabel = Instance.new("TextLabel")
    creditsLabel.Name = "Credits"
    creditsLabel.Size = UDim2.new(0, 200, 0, 30)
    creditsLabel.Position = UDim2.new(0.5, -100, 0, 10)
    creditsLabel.BackgroundTransparency = 0.5
    creditsLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    creditsLabel.Text = "Made by rackszn"
    creditsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    creditsLabel.TextScaled = true
    creditsLabel.Font = Enum.Font.GothamBold
    creditsLabel.Parent = screenGui
    
    -- Add corner rounding
    local creditsCorner = Instance.new("UICorner")
    creditsCorner.CornerRadius = UDim.new(0, 8)
    creditsCorner.Parent = creditsLabel
    
    -- ESP Toggle Button (Top right corner)
    espToggleButton = Instance.new("TextButton")
    espToggleButton.Name = "ESPToggleButton"
    espToggleButton.Size = UDim2.new(0, 120, 0, 40)
    espToggleButton.Position = UDim2.new(1, -140, 0, 10)
    espToggleButton.BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
    espToggleButton.Text = ESP_ENABLED and "ESP: ON" or "ESP: OFF"
    espToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
    espToggleButton.TextScaled = true
    espToggleButton.Font = Enum.Font.GothamBold
    espToggleButton.Parent = screenGui
    
    -- Add corner rounding to button
    local buttonCorner = Instance.new("UICorner")
    buttonCorner.CornerRadius = UDim.new(0, 8)
    buttonCorner.Parent = espToggleButton
    
    -- Keybind List (Middle Left)
    keybindListLabel = Instance.new("TextLabel")
    keybindListLabel.Name = "KeybindList"
    keybindListLabel.Size = UDim2.new(0, 200, 0, 120)
    keybindListLabel.Position = UDim2.new(0, 10, 0.5, -60)
    keybindListLabel.BackgroundTransparency = 0.3
    keybindListLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    keybindListLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    keybindListLabel.TextScaled = true
    keybindListLabel.Font = Enum.Font.Gotham
    keybindListLabel.Text = "Keybinds:\n\nF1 - Toggle GUI\nF - Aimbot Lock/Unlock\nU - Teleport to Target"
    keybindListLabel.TextXAlignment = Enum.TextXAlignment.Left
    keybindListLabel.TextYAlignment = Enum.TextYAlignment.Top
    keybindListLabel.Parent = screenGui
    
    -- Add corner rounding to keybind list
    local keybindCorner = Instance.new("UICorner")
    keybindCorner.CornerRadius = UDim.new(0, 8)
    keybindCorner.Parent = keybindListLabel
    
    -- Button hover effect
    espToggleButton.MouseEnter:Connect(function()
        local hoverTween = TweenService:Create(espToggleButton, 
            TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
            {BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0, 200, 0) or Color3.fromRGB(200, 0, 0)}
        )
        hoverTween:Play()
    end)
    
    espToggleButton.MouseLeave:Connect(function()
        local hoverTween = TweenService:Create(espToggleButton, 
            TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
            {BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)}
        )
        hoverTween:Play()
    end)
    
    -- ESP Toggle functionality
    espToggleButton.MouseButton1Click:Connect(function()
        ESP_ENABLED = not ESP_ENABLED
        espToggleButton.BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
        espToggleButton.Text = ESP_ENABLED and "ESP: ON" or "ESP: OFF"
        
        -- Toggle ESP visibility
        for player, esp in pairs(espObjects) do
            if DrawingAPI then
                if esp.nameLabel then
                    esp.nameLabel.Visible = ESP_ENABLED
                end
                for _, box in pairs(esp.boxes or {}) do
                    if box then box.Visible = ESP_ENABLED end
                end
                if esp.tracer then
                    esp.tracer.Visible = ESP_ENABLED
                end
            else
                if esp.billboard then
                    esp.billboard.Enabled = ESP_ENABLED
                end
                if esp.highlight then
                    esp.highlight.Enabled = ESP_ENABLED
                end
            end
        end
    end)
    
    -- Toggle GUI visibility with F1 key
    UserInputService.InputBegan:Connect(function(input, gameProcessed)
        if not gameProcessed and input.KeyCode == Enum.KeyCode.F1 then
            guiVisible = not guiVisible
            if screenGui then
                screenGui.Enabled = guiVisible
            end
        end
    end)
end

-- Function to create ESP for a player
local function createESP(player: Player): ()
    if player == localPlayer or espObjects[player] then
        return
    end
    
    if TEAM_CHECK and player.Team == localPlayer.Team then
        return
    end
    
    -- Use BillboardGui method if Drawing API isn't available
    if not DrawingAPI then
        if player.Character then
            createBillboardESP(player)
        else
            player.CharacterAdded:Connect(function()
                createBillboardESP(player)
            end)
        end
        return
    end
    
    -- Drawing API method
    local esp: ESPObject = {
        player = player,
        boxes = {},
        nameLabel = nil,
        tracer = nil
    }
    
    local teamColors = getTeamColors(player)
    
    if SHOW_NAMES then
        esp.nameLabel = createDrawing("Text", {
            Text = player.Name .. (player.Team and " [" .. player.Team.Name .. "]" or ""),
            Size = 20,
            Center = true,
            Outline = true,
            OutlineColor = Color3.fromRGB(0, 0, 0),
            Color = teamColors.text,
            Visible = false
        })
    end
    
    if SHOW_BOXES then
        esp.boxes = {}
        for i = 1, 4 do
            esp.boxes[i] = createDrawing("Line", {
                Color = teamColors.box,
                Thickness = 2,
                Visible = false
            })
        end
    end
    
    if SHOW_TRACER then
        esp.tracer = createDrawing("Line", {
            Color = teamColors.box,
            Thickness = 1,
            Visible = false
        })
    end
    
    espObjects[player] = esp
    
    -- Update colors when team changes
    if player.Team then
        player.Team:GetPropertyChangedSignal("Name"):Connect(function()
            updateESPColors(player)
        end)
    end
    
    player.CharacterRemoving:Connect(function()
        removeESP(player)
    end)
end

-- Function to update ESP colors when team changes
local function updateESPColors(player: Player): ()
    local esp = espObjects[player]
    if not esp then return end
    
    local teamColors = getTeamColors(player)
    
    if DrawingAPI then
        if esp.nameLabel then
            esp.nameLabel.Text = player.Name .. (player.Team and " [" .. player.Team.Name .. "]" or "")
            esp.nameLabel.Color = teamColors.text
        end
        for _, box in pairs(esp.boxes or {}) do
            if box then box.Color = teamColors.box end
        end
        if esp.tracer then
            esp.tracer.Color = teamColors.box
        end
    else
        if esp.billboard then
            local nameLabel = esp.billboard:FindFirstChild("TextLabel")
            if nameLabel then
                nameLabel.Text = player.Name .. (player.Team and " [" .. player.Team.Name .. "]" or "")
                nameLabel.TextColor3 = teamColors.text
            end
        end
        if esp.highlight then
            esp.highlight.Color3 = teamColors.box
        end
    end
end

-- Function to remove ESP
local function removeESP(player: Player): ()
    local esp = espObjects[player]
    if esp then
        if DrawingAPI then
            if esp.nameLabel then
                pcall(function() esp.nameLabel:Remove() end)
            end
            for _, box in pairs(esp.boxes or {}) do
                pcall(function() box:Remove() end)
            end
            if esp.tracer then
                pcall(function() esp.tracer:Remove() end)
            end
        else
            if esp.billboard then
                esp.billboard:Destroy()
            end
            if esp.highlight then
                esp.highlight:Destroy()
            end
        end
        espObjects[player] = nil
    end
end

-- Update ESP positions (handles both Drawing API and BillboardGui)
local function updateESP(): ()
    if not ESP_ENABLED then
        return
    end
    
    for player, esp in pairs(espObjects) do
        local character = player.Character
        
        -- Handle BillboardGui ESP (no position updates needed, just visibility)
        if not DrawingAPI then
            if esp.billboard then
                esp.billboard.Enabled = ESP_ENABLED and character ~= nil
            end
            if esp.highlight then
                esp.highlight.Enabled = ESP_ENABLED and character ~= nil
            end
            continue
        end
        
        -- Handle Drawing API ESP
        if not esp.boxes and not esp.nameLabel then
            continue
        end
        
        if not character then
            for _, box in pairs(esp.boxes or {}) do
                if box then box.Visible = false end
            end
            if esp.nameLabel then
                esp.nameLabel.Visible = false
            end
            if esp.tracer then
                esp.tracer.Visible = false
            end
            continue
        end
        
        local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") :: Part?
        local humanoid = character:FindFirstChild("Humanoid") :: Humanoid?
        
        if not humanoidRootPart or not humanoid then
            continue
        end
        
        local rootPosition, rootOnScreen = camera:WorldToViewportPoint(humanoidRootPart.Position)
        
        if rootOnScreen then
            local head = character:FindFirstChild("Head") :: Part?
            local headPosition = head and camera:WorldToViewportPoint(head.Position) or rootPosition
            
            local height = math.abs(headPosition.Y - rootPosition.Y)
            local width = height / 2
            
            local topY = headPosition.Y - height / 2
            local bottomY = rootPosition.Y + height / 2
            local leftX = rootPosition.X - width / 2
            local rightX = rootPosition.X + width / 2
            
            if SHOW_BOXES and esp.boxes and #esp.boxes >= 4 then
                if esp.boxes[1] then
                    esp.boxes[1].From = Vector2.new(leftX, topY)
                    esp.boxes[1].To = Vector2.new(rightX, topY)
                    esp.boxes[1].Visible = true
                end
                if esp.boxes[2] then
                    esp.boxes[2].From = Vector2.new(leftX, bottomY)
                    esp.boxes[2].To = Vector2.new(rightX, bottomY)
                    esp.boxes[2].Visible = true
                end
                if esp.boxes[3] then
                    esp.boxes[3].From = Vector2.new(leftX, topY)
                    esp.boxes[3].To = Vector2.new(leftX, bottomY)
                    esp.boxes[3].Visible = true
                end
                if esp.boxes[4] then
                    esp.boxes[4].From = Vector2.new(rightX, topY)
                    esp.boxes[4].To = Vector2.new(rightX, bottomY)
                    esp.boxes[4].Visible = true
                end
            end
            
            if SHOW_NAMES and esp.nameLabel then
                esp.nameLabel.Position = Vector2.new(rootPosition.X, topY - 20)
                esp.nameLabel.Visible = true
            end
            
            if SHOW_TRACER and esp.tracer then
                local screenCenter = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y)
                esp.tracer.From = screenCenter
                esp.tracer.To = Vector2.new(rootPosition.X, rootPosition.Y)
                esp.tracer.Visible = true
            end
        else
            for _, box in pairs(esp.boxes or {}) do
                if box then box.Visible = false end
            end
            if esp.nameLabel then
                esp.nameLabel.Visible = false
            end
            if esp.tracer then
                esp.tracer.Visible = false
            end
        end
    end
end

-- AIMBOT FUNCTIONS --

-- Function to find closest player to cursor
local function getClosestPlayerToCursor(): Player?
    local closestDistance = math.huge
    local target: Player? = nil
    local mouseLocation = UserInputService:GetMouseLocation()
    
    for _, player in pairs(Players:GetPlayers()) do
        if player == localPlayer then continue end
        
        local character = player.Character
        if not character then continue end
        
        local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") :: Part?
        if not humanoidRootPart then continue end
        
        -- Check if player is on screen
        local screenPosition, onScreen = camera:WorldToViewportPoint(humanoidRootPart.Position)
        if not onScreen then continue end
        
        -- Calculate distance from cursor
        local distance = (Vector2.new(screenPosition.X, screenPosition.Y) - mouseLocation).Magnitude
        
        if distance < closestDistance then
            closestDistance = distance
            target = player
        end
    end
    
    return target
end

-- Function to create highlight for target
local function createTargetHighlight(player: Player): ()
    if targetHighlight then
        targetHighlight:Destroy()
        targetHighlight = nil
    end
    if targetFill then
        targetFill:Destroy()
        targetFill = nil
    end
    
    local character = player.Character
    if not character then return end
    
    -- Create SelectionBox for outline
    targetHighlight = Instance.new("SelectionBox")
    targetHighlight.Adornee = character
    targetHighlight.Color3 = HIGHLIGHT_COLOR
    targetHighlight.Transparency = HIGHLIGHT_TRANSPARENCY
    targetHighlight.LineThickness = 0.05
    targetHighlight.Parent = workspace
    
    -- Create Highlight for fill effect
    targetFill = Instance.new("Highlight")
    targetFill.Adornee = character
    targetFill.FillColor = HIGHLIGHT_FILL_COLOR
    targetFill.FillTransparency = HIGHLIGHT_FILL_TRANSPARENCY
    targetFill.OutlineColor = HIGHLIGHT_COLOR
    targetFill.OutlineTransparency = 0
    targetFill.Parent = workspace
end

-- Function to remove highlights
local function removeTargetHighlight(): ()
    if targetHighlight then
        targetHighlight:Destroy()
        targetHighlight = nil
    end
    if targetFill then
        targetFill:Destroy()
        targetFill = nil
    end
end

-- Function to get aim position
local function getAimPosition(player: Player): Vector3?
    local character = player.Character
    if not character then return nil end
    
    local targetPart = character:FindFirstChild(AIM_BONE) :: Part?
    if not targetPart then
        targetPart = character:FindFirstChild("HumanoidRootPart") :: Part?
    end
    
    return targetPart and targetPart.Position or nil
end

-- Function to start aiming
local function startAiming(): ()
    if aimConnection then
        aimConnection:Disconnect()
        aimConnection = nil
    end
    
    aimConnection = RunService.RenderStepped:Connect(function()
        if not AIMBOT_ENABLED or not targetPlayer then
            if aimConnection then
                aimConnection:Disconnect()
                aimConnection = nil
            end
            return
        end
        
        local aimPosition = getAimPosition(targetPlayer)
        if aimPosition then
            -- Instant lock-on - no smoothing
            camera.CFrame = CFrame.lookAt(camera.CFrame.Position, aimPosition)
        end
    end)
end

-- Function to stop aiming
local function stopAiming(): ()
    if aimConnection then
        aimConnection:Disconnect()
        aimConnection = nil
    end
end

-- Function to teleport to target
local function teleportToTarget(): ()
    if not targetPlayer then
        showNotification("No target to teleport to")
        return
    end
    
    local character = targetPlayer.Character
    if not character then
        showNotification("Target has no character")
        return
    end
    
    local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") :: Part?
    if not humanoidRootPart then
        showNotification("Target has no HumanoidRootPart")
        return
    end
    
    local localCharacter = localPlayer.Character
    if not localCharacter then
        showNotification("You have no character")
        return
    end
    
    local localHumanoidRootPart = localCharacter:FindFirstChild("HumanoidRootPart") :: Part?
    if not localHumanoidRootPart then
        showNotification("You have no HumanoidRootPart")
        return
    end
    
    -- Teleport with slight offset to avoid collision
    local offset = Vector3.new(0, 5, 0) -- 5 studs above target
    localHumanoidRootPart.CFrame = CFrame.new(humanoidRootPart.Position + offset)
    
    showNotification("Teleported to " .. targetPlayer.Name)
end

-- Function to check if target is dead and unlock
local function checkTargetHealth(): ()
    if not targetPlayer or not isLocked then return end
    
    local character = targetPlayer.Character
    if not character then
        if isLocked then
            toggleAimbot()
            showNotification("Target eliminated - UNLOCKED")
        end
        return
    end
    
    local humanoid = character:FindFirstChild("Humanoid") :: Humanoid?
    if humanoid and humanoid.Health <= 0 then
        if isLocked then
            toggleAimbot()
            showNotification("Target eliminated - UNLOCKED")
        end
    end
end

-- Function to toggle aimbot
local function toggleAimbot(): ()
    isLocked = not isLocked
    
    if isLocked then
        -- Lock on to nearest player
        targetPlayer = getClosestPlayerToCursor()
        if targetPlayer then
            createTargetHighlight(targetPlayer)
            AIMBOT_ENABLED = true
            startAiming()
            showNotification("LOCKED onto " .. targetPlayer.Name)
        else
            isLocked = false
            showNotification("No target found")
        end
    else
        -- Unlock
        AIMBOT_ENABLED = false
        targetPlayer = nil
        removeTargetHighlight()
        stopAiming()
        showNotification("UNLOCKED")
    end
end

-- Function to update highlight for nearest player (when not locked)
local function updateNearestHighlight(): ()
    if isLocked then return end
    
    local nearest = getClosestPlayerToCursor()
    if nearest ~= targetPlayer then
        targetPlayer = nearest
        if targetPlayer then
            createTargetHighlight(targetPlayer)
        else
            removeTargetHighlight()
        end
    end
end

-- Input handling
UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    
    if input.KeyCode == Enum.KeyCode.F then
        toggleAimbot()
    elseif input.KeyCode == Enum.KeyCode.U then
        teleportToTarget()
    end
end)

-- Update loop for ESP and aimbot
RunService.RenderStepped:Connect(function()
    -- Update ESP (both Drawing API and BillboardGui)
    updateESP()
    
    -- Update aimbot
    if not isLocked then
        updateNearestHighlight()
    else
        checkTargetHealth()
    end
end)

-- Cleanup on player removal
Players.PlayerRemoving:Connect(function(player)
    if player == targetPlayer then
        if isLocked then
            toggleAimbot() -- Unlock if target leaves
        else
            targetPlayer = nil
            removeTargetHighlight()
        end
    end
    removeESP(player)
end)

-- Cleanup on character removal
local function onCharacterRemoving(character: Model)
    local player = Players:GetPlayerFromCharacter(character)
    if player == targetPlayer then
        if isLocked then
            toggleAimbot() -- Unlock if target's character removes
        else
            targetPlayer = nil
            removeTargetHighlight()
        end
    end
    removeESP(player)
end

-- Connect character removal events
for _, player in pairs(Players:GetPlayers()) do
    if player.Character then
        player.CharacterRemoving:Connect(onCharacterRemoving)
    end
    player.CharacterAdded:Connect(function(character)
        characterRemoving:Connect(onCharacterRemoving)
    end)
end

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        characterRemoving:Connect(onCharacterRemoving)
    end)
    task.spawn(function()
        createESP(player)
    end)
end)

-- Initialize
task.wait(0.5) -- Wait for character to load

-- Create GUI
createGUI()

for _, player in pairs(Players:GetPlayers()) do
    task.spawn(function()
        createESP(player)
    end)
end

print("Combined ESP + Aimbot Script Loaded!")
print("Press F1 to toggle GUI visibility")
print("Press F to lock/unlock aimbot")
print("Press U to teleport to target")
print("ESP with team colors enabled")
print("Instant lock-on aimbot active")

Features & Information

F = aimbot U = tp to target while locked on toggle gui doesnt work if you have any suggestions add rackszn on discord, also rate the script if u can will add more soon also supports all executors but no mobile support
#prison life#prisonlife

Community Comments (3)

wavydemisewavydemiseDec 31, 2025

its so good bro, everything works! youre the best man

wavydemisewavydemiseDec 31, 2025

can you maybe change the aimlock key from F to Q. if not im not bothered just a prefrence

jvstrem7jvstrem7Jan 3, 2026

good

More Scripts for Universal Scripts