Narrow one Aimbot & ESP

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Narrow one Aimbot & ESP
// @namespace    http://tampermonkey.net/
// @version      2.2
// @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==

// ==UserScript==
// @name         Narrow one Aimbot & ESP
// @namespace    http://tampermonkey.net/
// @version      2.1
// @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==


const state = {
    ready: false,
    game: null,
    scene: null,
    myPlayer: null,
    playerList: [],
    enemyList: [],
    closestEnemy: { index: -1, distance: Infinity },
    aimbotEnabled: false,
    espEnabled: true
};

document.addEventListener("keyup", (e) => {
    if (e.key === "f") state.aimbotEnabled ^= 1;
    if (e.key === "e") state.espEnabled ^= 1;
});

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

    state.myPlayer = state.game.getMyPlayer();

    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;

    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);
};