Narrow one Aimbot & ESP

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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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