Zombia.io Select Name

This script is customizable

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Zombia.io Select Name
// @namespace    http://tampermonkey.net/
// @version      1
// @description  This script is customizable
// @author       Longxd#1621
// @match        http://zombia.io/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zombia.io
// @grant        none
// ==/UserScript==

var newSelect = document.createElement("select");
newSelect.classList.add("hud-intro-names");
newSelect.id = "hud-intro-names";
var optionGroup = document.createElement("optgroup");
optionGroup.label = "Select Names";
// vars for create a new option for add a new option just copy paste the var and change the number, example, option(n), "n" is a random number
var option1 = document.createElement("option");
var option2 = document.createElement("option");
option1.value = "opt1"; // value of the option
option1.text = "Longxd#1621"; // text that will be added to the name
option2.text = "wo"; // text that will be added to the name
option2.value = "opt2"; // value of the option
optionGroup.appendChild(option1);
optionGroup.appendChild(option2);
newSelect.appendChild(optionGroup);

var hudIntroFormElement = document.querySelector(".hud-intro-form");
hudIntroFormElement.appendChild(newSelect);

let css = `
select#hud-intro-names {
    display: block;
    width: 285px;
    height: 40px;
    margin-top: 5px;
    background-color: #8bdfb3; // find your favorite color
    padding: 8px 14px;
}
`
let styles = document.createElement("style");
styles.appendChild(document.createTextNode(css));
document.head.appendChild(styles);
styles.type = "text/css";

        var select = document.getElementById("hud-intro-names");
        var hudIntroName = document.querySelector(".hud-intro-name");
newSelect.addEventListener("change", function () {
    var selectedOption = newSelect.options[newSelect.selectedIndex];
    if (selectedOption.value === "opt1") { // you can copy paste this to infinites options with values
        hudIntroName.value = "Longxd#1621";
    } else if (selectedOption.value === "opt2") {
        hudIntroName.value = "wo";
    }
});