Shell Shockers ESP Script

Display players' names and health bars in Shell Shockers

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Shell Shockers ESP Script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Display players' names and health bars in Shell Shockers
// @author       Your Name
// @match        https://shellshockers.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to create and update ESP elements
    function updateESP() {
        // Select all player elements on the page
        let players = document.querySelectorAll('.player');

        players.forEach(player => {
            // Get player name and health
            let playerName = player.querySelector('.name').textContent.trim();
            let playerHealth = parseInt(player.querySelector('.health').textContent.trim());

            // Create or update an ESP element for each player
            let espElement = document.getElementById(`esp-${playerName}`);
            if (!espElement) {
                espElement = document.createElement('div');
                espElement.id = `esp-${playerName}`;
                espElement.style.position = 'absolute';
                espElement.style.color = 'white';
                espElement.style.fontFamily = 'Arial, sans-serif';
                espElement.style.fontSize = '12px';
                document.body.appendChild(espElement);
            }

            // Position the ESP element above the player's head
            let rect = player.getBoundingClientRect();
            espElement.style.top = `${rect.top - 20}px`;
            espElement.style.left = `${rect.left}px`;

            // Update ESP text (name and health)
            espElement.textContent = `${playerName} (${playerHealth} HP)`;
        });
    }

    // Call updateESP function initially and then every 500ms
    updateESP();
    setInterval(updateESP, 500);

})();