Shell Shockers ESP Script

Display players' names and health bars in Shell Shockers

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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

})();