#menu

1 messages · Page 1 of 1 (latest)

quasi swan
#

I need the menu to open when a player clicks on another player with shift

#

press the button and the player has 1 scoreboard recorded

fathom perch
quasi swan
#

how to check 1 or more scoreboard

#

Target

fathom perch
#

what do you mean? like, check if the target has 1 or more on a scoreboard?

quasi swan
#

Yes

fathom perch
#

ill try and figure it out gimmie a minute

#
world.beforeEvents.playerInteractWithEntity.subscribe((eventData) => {
    if (eventData.target.typeId == "minecraft:player" && eventData.player.isSneaking && world.scoreboard.getObjective("objectiveId").getScore(eventData.target.scoreboardIdentity) > 0) {
        // menu code
    }
})```
#

that should work

#

you hsould probably add a check to the .getScore to make sure it doesnt return undefined, just in case

quasi swan
#

Thanks