#How do I detect, add or set scores in Gametest?

1 messages · Page 1 of 1 (latest)

tough minnow
#

How do I detect, add or set scores in Gametest?

#

Is it possible, for example, to decrease the score when you right click and set the score to 30 when you left click (attack)?

fallow yarrow
#
const scoreboard = world.scoreboard.getObjective('yourObjective')

scoreboard.getScore(entity.scoreboardIdentity)
scoreboard.setScore(entity.scoreboardIdentity, 0)
scoreboard.addScore(entity.scoreboardIdentity, 1)

To decrease the score use the right event and add -30 to the scoreboard

tough minnow
#
scoreboard.getScore(entity.scoreboard.minecraft:player)
#

Is it like this?