#Custom Commands

1 messages · Page 1 of 1 (latest)

bright oak
#

How I can change this script, for made it only for players who has tag "developer" ?


world.beforeEvents.chatSend.subscribe((data) => {
  let player = data.sender;
  let msg = data.message.toLowerCase();
  
if (msg === "!apple") {
  system.runTimeout(() => {
    player.runCommandAsync("give @s apple");
  }, 0);
  data.cancel = true;
}
});
solid knoll
#

Get the players tag and check in a if condition

kindred halo
bright oak
rare condor
#

Below let player do:

if (!player.hasTag('developer')) return;
bright oak
#

can you add this to my script, for I use where I need do it. For at the next time I know how to do it.

solid knoll
#

Just put it before the commands