I'm attempting to create an interface that allows players without permissions to activate commands by changing their own scoreboard value, however in order for this to work i need to reset their scoreboard number after the command has executed so the command doesn't repeat.
the player can use the command
/trigger test set 1
and a command block will execute a command at the player's position
However after the command has been activated i'm trying to reset the players scoreboard to zero with a command block running execute at @a trigger test set 0
which doesn't seem to do anything
Can anyone tell me what I am doing wrong?
P.S I already have a repeat command block running scoreboard players enable @a test
the issue command block just doesn't seem to be doing anything
Best Answer
To reset the players score to
0
you will need to useas
instead ofat
, to execute the trigger command AS the player, not at the player's location. You also forgot about therun
literal. Here's the correct command:In your case you can also simply use the
scoreboard
command like this:Or even like this, because you keep enabling it anyway, so it won't be removed from the scoreboard for longer than one tick: