scoreboard players tag @s[score_Menu_min=1000,score_Menu=1000] add Surrend
scoreboard players tag @s[score_Menu_min=1001,score_Menu=1001] remove Surrend

scoreboard players set @e[type=Villager,name=Blue] Tmp 0
scoreboard players set @e[type=Villager,name=Blue] Tmp2 0

#Counts the number of players
execute @s[team=Blue] ~ ~ ~ execute @a[score_InGame_min=1,team=Blue] ~ ~ ~ scoreboard players add @e[type=Villager,name=Blue] Tmp2 1
execute @s[team=Orange] ~ ~ ~ execute @a[score_InGame_min=1,team=Orange] ~ ~ ~ scoreboard players add @e[type=Villager,name=Blue] Tmp2 1

#Counts the number of surrends
execute @s[team=Blue] ~ ~ ~ execute @a[score_InGame_min=1,team=Blue,tag=Surrend] ~ ~ ~ scoreboard players add @e[type=Villager,name=Blue] Tmp 1
execute @s[team=Orange] ~ ~ ~ execute @a[score_InGame_min=1,team=Orange,tag=Surrend] ~ ~ ~ scoreboard players add @e[type=Villager,name=Blue] Tmp 1

#Tells the team
execute @s[team=Blue,score_Menu_min=1000,score_Menu=1000] ~ ~ ~ tellraw @a[team=Blue,score_InGame_min=1,score_InGame=1] {"text":"> ","bold":"true","extra":[{"selector":"@s"},{"text":" voted to surrender. Votes: (","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp"},"color":"gold"},{"text":"/","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp2"},"color":"gold"},{"text":")","bold":"false"}]}
execute @s[team=Orange,score_Menu_min=1000,score_Menu=1000] ~ ~ ~ tellraw @a[team=Orange,score_InGame_min=1,score_InGame=1] {"text":"> ","bold":"true","extra":[{"selector":"@s"},{"text":" voted to surrender. Votes: (","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp"},"color":"gold"},{"text":"/","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp2"},"color":"gold"},{"text":")","bold":"false"}]}

execute @s[team=Blue,score_Menu_min=1001,score_Menu=1001] ~ ~ ~ tellraw @a[team=Blue,score_InGame_min=1,score_InGame=1] {"text":"> ","bold":"true","extra":[{"selector":"@s"},{"text":" want to keep fighting. Votes: (","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp"},"color":"gold"},{"text":"/","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp2"},"color":"gold"},{"text":")","bold":"false"}]}
execute @s[team=Orange,score_Menu_min=1001,score_Menu=1001] ~ ~ ~ tellraw @a[team=Orange,score_InGame_min=1,score_InGame=1] {"text":"> ","bold":"true","extra":[{"selector":"@s"},{"text":" want to keep fighting. Votes: (","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp"},"color":"gold"},{"text":"/","bold":"false"},{"score":{"name":"@e[type=Villager,name=Blue]","objective":"Tmp2"},"color":"gold"},{"text":")","bold":"false"}]}

#Sound
execute @s[team=Blue] ~ ~ ~ playsound block.note.snare ambient @a[team=Blue]
execute @s[team=Orange] ~ ~ ~ playsound block.note.snare ambient @a[team=Orange]

clear @s written_book
scoreboard players set @s Menu 0