3D Box ESP
Key Required

3D Box ESP

Murder Mystery 2AuraAura 49.3K views 1.6K executesUpdated Aug 15, 2023
5.0/ 5(2 votes)
20100% Positive
Lua Script•95 lines (2951 chars)
-- Services
local RunService = game:GetService("RunService");
local PlayersService = game:GetService("Players");

-- Variables
local Camera = workspace.CurrentCamera;
local Lines = {};
local Quads = {};

-- Functions
local function HasCharacter(Player)
    return Player.Character and Player.Character:FindFirstChild("HumanoidRootPart");
end;

local function GetPlayerColor(Player)
    local Character = Player.Character
    local Backpack = Player:FindFirstChild("Backpack")
    
    if (Backpack and Backpack:FindFirstChild("Knife")) or (Character and Character:FindFirstChild("Knife")) then
        return Color3.fromRGB(255, 0, 0)  -- Red for players with a Knife
    elseif (Backpack and Backpack:FindFirstChild("Gun")) or (Character and Character:FindFirstChild("Gun")) then
        return Color3.fromRGB(0, 0, 255)  -- Blue for players with a Gun
    else
        return Color3.fromRGB(0, 255, 0)  -- Green for all other players
    end
end

local function DrawLine(From, To, color)
    local FromScreen, FromVisible = Camera:WorldToViewportPoint(From);
    local ToScreen, ToVisible = Camera:WorldToViewportPoint(To);

    if (not FromVisible and not ToVisible) then return; end;

    local FromPos = Vector2.new(FromScreen.X, FromScreen.Y);
    local ToPos = Vector2.new(ToScreen.X, ToScreen.Y);

    local Line = Drawing.new("Line");
        Line.Thickness = 1;
        Line.From = FromPos
        Line.To = ToPos
        Line.Color = color or Color3.fromRGB(255, 255, 255);
        Line.Transparency = 1;
        Line.ZIndex = 1;
        Line.Visible = true;

    table.insert(Lines, Line)
end

local function GetCorners(Part)
    local CF, Size, Corners = Part.CFrame, Part.Size / 2, {};
    for X = -1, 1, 2 do for Y = -1, 1, 2 do for Z = -1, 1, 2 do
        Corners[#Corners+1] = (CF * CFrame.new(Size * Vector3.new(X, Y, Z))).Position;      
    end; end; end;
    return Corners;
end;

local function DrawEsp(Player)
    local HRP = Player.Character.HumanoidRootPart
    local CubeVertices = GetCorners({CFrame = HRP.CFrame * CFrame.new(0, -0.5, 0), Size = Vector3.new(3, 5, 3)})

    -- Get player's color based on their tools
    local playerColor = GetPlayerColor(Player)

    -- Drawing the 3D box using DrawLine function
    local connections = {
        {1, 2}, {2, 6}, {6, 5}, {5, 1}, 
        {1, 3}, {2, 4}, {6, 8}, {5, 7},
        {3, 4}, {4, 8}, {8, 7}, {7, 3}
    }
    
    for _, pair in pairs(connections) do
        DrawLine(CubeVertices[pair[1]], CubeVertices[pair[2]], playerColor)
    end
end;

local function BoxEsp()
    local Players = PlayersService:GetPlayers();

    for i = 1, #Lines do
        local Line = rawget(Lines, i);
        if (Line) then Line:Remove(); end;
    end;

    Lines = {};

    for i = 1, #Players do
        local Player = rawget(Players, i);
        if HasCharacter(Player) then
            DrawEsp(Player);
        end;
    end;
end;

-- Main
RunService.RenderStepped:Connect(BoxEsp);

Features & Information

Made this 3D box Esp for murder mystery 2 it shows innocent sheriff and murderer. it might crash on electron btw it was made by ChatGPT under Flames so idk https://discord.gg/MpY7h3WqNh
#ESP#Free#Murder Mystery

Community Comments (5)

khalidulabib4khalidulabib4Jun 20, 2025

its lag so much it made the game buggier

mrn_jrmrn_jrOct 31, 2025

literally by ai btw

Joyful_PizzaPartylJoyful_PizzaPartylFeb 11, 2026

Hey uhh Hrp(HumanoidRootPart) is a box And you can just highlight rootpart not draw shapes

Joyful_PizzaPartylJoyful_PizzaPartylFeb 11, 2026

Make this a lot simple

64va64vaJul 21, 2026

script with no optimization🤷‍♂️

More Scripts for Murder Mystery 2