Narrow one Aimbot & ESP & Fly & No clip MODMENU

(F) To toggle Aimbot (E) to toggle ESP

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Narrow one Aimbot & ESP & Fly & No clip MODMENU
// @namespace    http://tampermonkey.net/
// @version      3.4
// @description  (F) To toggle Aimbot (E) to toggle ESP
// @author       Dominus Gabi
// @match        https://narrow.one/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=narrow.one
// @grant        none
// @require      https://unpkg.com/[email protected]/build/three.min.js
// @license      MIT
// ==/UserScript==


window.state = {
    offsetX: 0,
    offsetY: 0,
    dragging: false,
    ready: false,
    game: null,
    scene: null,
    myPlayer: null,
    rigidBody: null,
    playerList: [],
    enemyList: [],
    closestEnemy: { index: -1, distance: Infinity },
    aimbotEnabled: false,
    espEnabled: true
};

document.addEventListener("keyup", (e) => {
    if (e.key === "f") {
        document.querySelectorAll("[type='checkbox']")[0].click()
    }
    if (e.key === "e") {
        document.querySelectorAll("[type='checkbox']")[1].click()
    }
});

function updateGame() {
    if (!state.game?.gameStarted) return;

    state.myPlayer = state.game.getMyPlayer();
    state.rigidBody = [...state.myPlayer?.physicsManager.rigidBodies].filter((e) => {
        return e.player?.id == state.myPlayer.id
    })[0]

    if (!state.myPlayer) {
        state.ready = false;
        state.playerList = [];
        state.enemyList = [];
        state.closestEnemy.index = -1;
        state.closestEnemy.distance = Infinity;
        return;
    }

    state.ready = true;
    state.playerList = [...state.game.players.values()]
        .filter(e => e && e.id !== state.myPlayer.id);
    state.enemyList = state.playerList.filter(
        e => e.teamId !== state.myPlayer.teamId
    );

    findClosestEnemy();
    aimbot();
    esp();
}

function findClosestEnemy() {
    state.closestEnemy.index = -1;
    state.closestEnemy.distance = Infinity;
    1
    var myPos = state.myPlayer?.obj?.position;
    if (!myPos) return;

    state.enemyList.forEach((e, i) => {
        var pos = e?.obj?.position;
        if (!pos) return;

        var distance = myPos.distanceTo(pos);

        if (distance < state.closestEnemy.distance) {
            state.closestEnemy.index = i;
            state.closestEnemy.distance = distance;
        }
    });
}

function aimbot() {
    if (!state.aimbotEnabled || !state.ready) return;

    var enemy = state.enemyList[state.closestEnemy.index];
    if (!enemy?.pos) return;

    var dx = enemy.pos.x - state.myPlayer.pos.x;
    var dy = enemy.pos.y - state.myPlayer.pos.y;
    var dz = enemy.pos.z - state.myPlayer.pos.z;

    state.myPlayer.lookRot.x = Math.atan2(-dx, -dz);
    state.myPlayer.lookRot.y = Math.atan2(
        dy,
        Math.sqrt(dx * dx + dz * dz)
    );
}

function esp() {
    state.playerList.forEach(player => {
        var obj = player?.obj;
        if (!obj) return;

        if (!state.espEnabled) {
            if (obj.espBox) obj.espBox.visible = false;
            return;
        }

        if (obj.espBox) {
            obj.espBox.visible = true;
            return;
        }

        var bbox = new THREE.Box3().setFromObject(obj);
        var size = new THREE.Vector3();
        var center = new THREE.Vector3();

        bbox.getSize(size);
        bbox.getCenter(center);

        var geometry = new THREE.EdgesGeometry(
            new THREE.BoxGeometry(size.x, size.y, size.z)
        );

        var material = new THREE.LineBasicMaterial({
            color: player.teamId === state.myPlayer.teamId
            ? 0x00ff00
            : 0xff0000,
            depthTest: false
        });

        var box = new THREE.LineSegments(geometry, material);

        box.position.copy(obj.worldToLocal(center.clone()));
        box.position.y += 1;
        box.frustumCulling = false;
        box.renderOrder = 9999;

        obj.add(box);
        obj.espBox = box;
    });
}

var originalPush = Array.prototype.push;

Array.prototype.push = function (...args) {
    var game = args[0]?.playerCollider?.rigidBody?.player?.game;
    if (game) {
        state.game = game;
        state.scene = game.scene?.parent;
        updateGame();
    }
    return originalPush.apply(this, args);
};





var c = document.createElement('div')

c.innerHTML = `
<div id="wrap">
    <div id="header">
        <h2>double click to hide</h2>
        <p>by gabi</p>
    </div>

    <div id="options">

        <div class="option">
            <span>aimbot (toggle f)</span>
            <input type="checkbox">
        </div>

        <div class="option">
            <span>esp (toggle e)</span>
            <input type="checkbox" checked>
        </div>

        <div class="option">
            <span>fly</span>
            <input type="checkbox">
        </div>

        <div class="option">
            <span>noclip</span>
            <input type="checkbox">
        </div>

        <div class="option">
            <span>walk speed <br>(60)</span>
            <input type="range" min="0" max="200" value="60">
        </div>

        <div class="option">
            <span>jump height <br>(8.6)</span>
            <input type="range" step="0.2" min="0" max="30" value="8.6">
        </div>

    </div>
</div>

<style>

body {
    margin: 0;
    background: gray;
}

.hidden {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
}

.hidden #options,
.hidden h2,
.hidden p {
    display: none;
}

#wrap {
    font-family: BlueNight, sans-serif;
    position: fixed;
    width: 250px;
    height: 300px;
    top: 20px;
    left: 20px;
    background: white;
    border: 3px solid black;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 999999;
    touch-action: none;
    transition: width 0.2s, height 0.2s, border-radius 0.4s;
    color: black;
}

#header {
    height: 12%;
    border-bottom: 3px solid black;
    padding: 5px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#header:active {
    cursor: grabbing;
}

#header h2 {
    margin: 0;
    font-size: 20px;
}

#header p {
    margin: 0;
    font-size: 14px;
}

#options {
    flex: 1;
    overflow-y: auto;
}

.option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 2px solid black;
    min-height: 38px;
}

.option:last-child {
    border-bottom: none;
}

.option span {
    font-size: 20px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

input[type="range"] {
    width: 100px;
}

#options::-webkit-scrollbar {
    width: 5px;
}

#options::-webkit-scrollbar-track {
    background: #ddd;
}

#options::-webkit-scrollbar-thumb {
    background: black;
}
</style>
`;

document.body.appendChild(c);

var wrap = document.querySelector("#wrap");
var header = document.querySelector("#header");
var options = [...document.querySelector("#options").children]

wrap.ondblclick =_=> wrap.classList.toggle("hidden");
document.querySelectorAll('input[type="range"]').forEach(slider => {
    var label = slider.previousElementSibling;
    var update =_=> {
        label.innerHTML = label.innerHTML.replace(/\(.*?\)/, `(${slider.value})`);
    };
    slider.addEventListener("input", update);
    update();
});
header.addEventListener("pointerdown", e => {
    state.dragging = true;
    var rect = wrap.getBoundingClientRect();
    state.offsetX = e.clientX - rect.left;
    state.offsetY = e.clientY - rect.top;

    header.setPointerCapture(e.pointerId);
});

header.addEventListener("pointermove", e => {
    if (!state.dragging) return;

    var x = e.clientX - state.offsetX;
    var y = e.clientY - state.offsetY;

    x = Math.max(0, Math.min(window.innerWidth - wrap.offsetWidth, x));
    y = Math.max(0, Math.min(window.innerHeight - wrap.offsetHeight, y));

    wrap.style.left = x + "px";
    wrap.style.top = y + "px";
});

function stopDrag() {
    state.dragging = false;
}

header.addEventListener("pointerup", stopDrag);
header.addEventListener("pointercancel", stopDrag);
window.addEventListener("resize", () => {
    const rect = wrap.getBoundingClientRect();

    wrap.style.left = Math.min(rect.left, window.innerWidth - wrap.offsetWidth) + "px";
    wrap.style.top = Math.min(rect.top, window.innerHeight - wrap.offsetHeight) + "px";
});



function mode(i,v){
    switch (i){
        case (0): state.aimbotEnabled = v;break
        case (1): state.espEnabled = v;break
        case (2): state.rigidBody.fly = v;break
        case (3): state.rigidBody.noclip = v;break
        case (4): state.myPlayer.walkSpeed = v;break
        case (5): state.myPlayer.jumpForce = v;break
    }
}
options.forEach((e,i)=>{
    e.addEventListener("click",()=>{
        const input = e.children[1]
        const value = input.type === "range"
        ? Number(input.value)
        : input.checked

        mode(i,value)
    })
})