#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#Switch
scoreboard players add @s[scores={click=1..}] mode 1
execute if score $game_type main matches 2 run scoreboard players set @s[scores={mode=3..}] mode 1

execute at @s run playsound minecraft:ui.button.click master @s[scores={click=1..}] ~ ~ ~
title @s title {"text":""}
title @s times 5 30 5
title @s[scores={mode=1}] subtitle ["",{"translate":"compass.switched","color":"gold","bold":true},{"translate":"compass.powerup","color":"white","bold":true}]
title @s[scores={mode=2}] subtitle ["",{"translate":"compass.switched","color":"gold","bold":true},{"translate":"compass.player","color":"white","bold":true}]
title @s[scores={mode=3}] subtitle ["",{"translate":"compass.switched","color":"gold","bold":true},{"translate":"compass.pumpkin","color":"white","bold":true}]

scoreboard players set @s[scores={mode=3..}] mode 0