pasteblox

Open Source MM2 ESP

142823291@scripterPublicUpdated

The loadstring always runs the latest version, v4. See what changed

loadstring(game:HttpGet("https://pasteblox.com/raw/9dsfevhjku"))()
Star 2Copy 0994 views

About

Keybind: K

What's new in v4

@scripter ·

large usernames fix

Script

pbx pull 9dsfevhjku
open-source-mm2-esp.luau
CodeDiff
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local CRC = require(game.ReplicatedStorage.Modules.CurrentRoundClient)

local plr = Players.LocalPlayer
local on = false
local esp = {}

local function clear()
    for _, v in pairs(esp) do
        v:Destroy()
    end
    table.clear(esp)
end

local function update()
    clear()
    if not on then return end

    for _, p in pairs(Players:GetPlayers()) do
        if p ~= plr and p.Character then
            local data = CRC.PlayerData[p.Name]
            local role = data and data.Role

            if role then
                local h = Instance.new("Highlight")
                h.FillColor = ({
                    Murderer = Color3.fromRGB(255, 50, 50),
                    Sheriff = Color3.fromRGB(50, 150, 255),
                    Innocent = Color3.fromRGB(220, 220, 220)
                })[role] or Color3.new(1, 1, 1)
                h.Parent = p.Character
                table.insert(esp, h)
            end

            local head = p.Character:FindFirstChild("Head")
            if head then
                local bill = Instance.new("BillboardGui")
				bill.Size = UDim2.new(0, 100, 0, 20)
				bill.StudsOffset = Vector3.new(0, 2.5, 0)
				bill.AlwaysOnTop = true
				bill.LightInfluence = 0
				bill.MaxDistance = 500
				bill.Adornee = head
				bill.Parent = head
				table.insert(esp, bill)
				
				local label = Instance.new("TextLabel")
				label.Size = UDim2.fromScale(1, 1)
				label.BackgroundTransparency = 1
				label.Text = p.Name
				label.TextColor3 = Color3.new(1, 1, 1)
				label.TextStrokeTransparency = 0
				label.TextScaled = false
				label.TextSize = 12
				label.Font = Enum.Font.GothamBold
				label.Parent = bill
            end
        end
    end
end

local function toggle()
    on = not on
    update()

    game:GetService("StarterGui"):SetCore("SendNotification", {
        Title = "ESP",
        Text = on and "ESP Enabled" or "ESP Disabled",
        Duration = 2
    })
end

if UIS.TouchEnabled and not UIS.KeyboardEnabled then
    local gui = Instance.new("ScreenGui")
    gui.Name = "ESPMobileUI"
    gui.ResetOnSpawn = false
    gui.Parent = plr:WaitForChild("PlayerGui")

    local button = Instance.new("TextButton")
    button.Size = UDim2.fromOffset(100, 45)
    button.Position = UDim2.new(1, -120, 0.5, -22)
    button.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
    button.TextColor3 = Color3.new(1, 1, 1)
    button.Text = "ESP: OFF"
    button.TextSize = 16
    button.Active = true
    button.Draggable = true
    button.Parent = gui

    Instance.new("UICorner", button).CornerRadius = UDim.new(0, 8)

    button.Activated:Connect(function()
        toggle()
        button.Text = on and "ESP: ON" or "ESP: OFF"
        button.BackgroundColor3 = on
            and Color3.fromRGB(35, 130, 65)
            or Color3.fromRGB(35, 35, 35)
    end)
else
    UIS.InputBegan:Connect(function(input, processed)
        if not processed and input.KeyCode == Enum.KeyCode.K then
            toggle()
        end
    end)
end

CRC.PlayerDataChanged.Event:Connect(update)

Players.PlayerAdded:Connect(function()
    task.wait(1)
    update()
end)

Players.PlayerRemoving:Connect(update)

Changelog

4 versions
  1. large usernames fix

    Live

    @scripter·+3 lines·

  2. usernames

    @scripter·+24 lines·

  3. mobile

    @scripter·+39 lines·

  4. First version

    @scripter·