#PLAYER LIST
1 messages · Page 1 of 1 (latest)
async function banMSG(player) {
const form = new ModalFormData();
const playerNames = world.getAllPlayers().map(p=>p.name)
form.title('§c- Ban Player -');
form.dropdown('§c\nSelect The Player!', playerNames);
form.show(player).then(result => {
if (result.canceled) return;
const targetName = playerNames[result.formValues[0]]
player.runCommand(`tag @a[tag=!Staff,name="${targetName}"] add banneda`);
player.runCommand(`title @s actionbar §aBanned ${targetName}`)
})};```
gets all the players in a list like u wanted
u gotta open the form
how to open the form?
tu veux faire un systeme de ban ??
non je voulais un menu ou ya tout les joueurs du monde connecter qui s'affiche
@wispy oyster
en gros je voulais que y'a une fonction dedans ya un titre au pif et des bouton et les boutons correspond a un joueur et quand tu clique dessus et quand tu clique sur le bouton d'un joueur sa envoie le message test au joueur selectionner @wispy oyster
car se que le mec en haut m'a envoyer ne marche pas donc jsp comment faire
et grace a sa j'aurais pu le modifier et faire se que je veux avec car j'ai juste besoin d'une base pour avoir l'accès a tout les joueurs connecter sur le serveur et quand tu clique sur le joueur au choix sa execute une action sur le joueur selectionner par exemple grace a sa je peux faire un freeze un mute etc tu vois
@wispy oyster
basically I wanted there to be a function in there, there is a random title and buttons and the buttons correspond to a player and when you click on them and when you click on a player's button it sends the test message to the player selected
because what the guy at the top sent me doesn't work so jsp how to do it
and thanks to this I could have modified it and done what I wanted with it because I just need a base to have access to all the players connected to the server and when you click on the player of your choice its execute an action on the selected player for example thanks to this I can do a freeze a mute etc you see
@mossy oyster
just have something open the form
@lone juniper the top code works , its a base function , you need after decide when the function will be start , by example by using a particular item or by particular acrion.