My First Multi-Player Radar

Scans and logs multiple players simultaneously using engine components

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Tendrás que instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Tendrás que instalar una extensión como Tampermonkey antes de poder instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name         My First Multi-Player Radar
// @namespace    http://tampermonkey.net
// @version      1.1
// @description  Scans and logs multiple players simultaneously using engine components
// @author       You
// @match        *://*.bloxd.io/*
// @match        *://*.bloxdhop.io/*
// @match        *://*://*
// @run-at       document-body
// @grant        none
// ==/UserScript==


(function() {
    'use strict';

    let savedEngine = null;

    // 1. THE ANTENNA: Hook into the game's loading files to grab the engine
    Object.defineProperty(Function.prototype, 'call', {
        enumerable: false,
        configurable: true,
        writable: true,
        value: function (thisArg, ...args) {
            const core = args[0];
            // If we catch a piece of code containing 'entities' and 'bloxd', save it!
            if (core && core.entities && core.bloxd) {
                savedEngine = core;
                console.log("Successfully hooked into the Bloxd engine!");
            }
            return Function.prototype.call.apply(this, [thisArg, ...args]);
        }
    });

    // 2. THE MULTI-TARGET MONITOR LOOP
    setInterval(() => {
        if (!savedEngine) return;

        // Fetch your own position (You are always ID 1)
        let pos = savedEngine.entities.getState(1, "position")?.position;
        if (!pos) return;

        // DYNAMIC SCANNER: Extract a fresh list of EVERY entity currently loaded around you
        let allPlayerIds = Object.keys(savedEngine.entities.components.position);

        // This loop automatically repeats your distance math for every single active ID found
        allPlayerIds.forEach(id => {
            if (id == "1") return; // Skip yourself to prevent self-targeting

            // Fetch the current loop player's coordinate array dynamically
            let enemypos = savedEngine.entities.getState(id, "position")?.position;
            if (!enemypos) return;

            // FIXED VECTOR MATH: Subtracting individual elements keeps the calculations stable
            let dx = pos[0] - enemypos[0];
            let dy = pos[1] - enemypos[1];
            let dz = pos[2] - enemypos[2];
            let distance = Math.sqrt(dx*dx + dy*dy + dz*dz);

            // Execute the action block if this specific player is within range
            if (distance <= 6.0) {
                console.log(`attack ID: ${id} | Distance: ${distance.toFixed(2)}`);
            }
        });
    }, 100);

})();