Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Part 1:
- execute store result score .red vote if entity @a[scores={vote=1}]
- execute store result score .blue vote if entity @a[scores={vote=2}]
- execute store result score .green vote if entity @a[scores={vote=3}]
- execute store result score .yellow vote if entity @a[scores={vote=4}]
- Part 2:
- scoreboard players operation .max vote = .red vote
- scoreboard players operation .max vote > .blue vote
- scoreboard players operation .max vote > .green vote
- scoreboard players operation .max vote > .yellow vote
- Part 3:
- execute if score .max vote = .red vote run tag @a[scores={vote=1}] add won
- execute if score .max vote = .blue vote run tag @a[scores={vote=2}] add won
- execute if score .max vote = .green vote run tag @a[scores={vote=3}] add won
- execute if score .max vote = .yellow vote run tag @a[scores={vote=4}] add won
- scoreboard players operation .choice vote = @a[tag=won,sort=random,limit=1] vote
- tag @a remove won
- Part 4:
- execute if score .choice vote matches 1 run say Picked Red!
- execute if score .choice vote matches 2 run say Picked Blue!
- execute if score .choice vote matches 3 run say Picked Green!
- execute if score .choice vote matches 4 run say Picked Yellow!
- scoreboard players reset * vote
Advertisement