execute if score .host_mode settings matches 1 unless entity @s[tag=op] run return run tellraw @s {"text":"\nYou do not have permission to toggle this in Host Mode! To toggle Host Mode an operator must type `/function pctf:host_mode/toggle`","color":"red"}
scoreboard players add .time_setting settings 1
execute if score .time_setting settings matches 5.. run scoreboard players set .time_setting settings 0

execute if score .time_setting settings matches 0 run setblock 8 101 18 oak_wall_sign[facing=north]{front_text:{messages:[{"text":"CYCLE","color":"yellow","bold":true,"click_event":{"action":"run_command","command":"/function pctf:logic/lobby/time/toggle"}},{"text":"Game Time Limit","color":"white"},{"text":"20 minutes","color":"gold","bold": true},""]},is_waxed:1b} destroy
execute if score .time_setting settings matches 0 run scoreboard players set .time settings 20

execute if score .time_setting settings matches 1 run setblock 8 101 18 oak_wall_sign[facing=north]{front_text:{messages:[{"text":"CYCLE","color":"yellow","bold":true,"click_event":{"action":"run_command","command":"/function pctf:logic/lobby/time/toggle"}},{"text":"Game Time Limit","color":"white"},{"text":"30 minutes","color":"gold","bold": true},{"text":"Default","color":"green"}]},is_waxed:1b} destroy
execute if score .time_setting settings matches 1 run scoreboard players set .time settings 30

execute if score .time_setting settings matches 2 run setblock 8 101 18 oak_wall_sign[facing=north]{front_text:{messages:[{"text":"CYCLE","color":"yellow","bold":true,"click_event":{"action":"run_command","command":"/function pctf:logic/lobby/time/toggle"}},{"text":"Game Time Limit","color":"white"},{"text":"45 minutes","color":"gold","bold": true},""]},is_waxed:1b} destroy
execute if score .time_setting settings matches 2 run scoreboard players set .time settings 45

execute if score .time_setting settings matches 3 run setblock 8 101 18 oak_wall_sign[facing=north]{front_text:{messages:[{"text":"CYCLE","color":"yellow","bold":true,"click_event":{"action":"run_command","command":"/function pctf:logic/lobby/time/toggle"}},{"text":"Game Time Limit","color":"white"},{"text":"60 minutes","color":"gold","bold": true},""]},is_waxed:1b} destroy
execute if score .time_setting settings matches 3 run scoreboard players set .time settings 60

execute if score .time_setting settings matches 4 run setblock 8 101 18 oak_wall_sign[facing=north]{front_text:{messages:[{"text":"CYCLE","color":"yellow","bold":true,"click_event":{"action":"run_command","command":"/function pctf:logic/lobby/time/toggle"}},{"text":"Game Time Limit","color":"white"},{"text":"90 minutes","color":"gold","bold": true},""]},is_waxed:1b} destroy
execute if score .time_setting settings matches 4 run scoreboard players set .time settings 90

execute if score .time_setting settings matches 0 run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 0.5
execute if score .time_setting settings matches 1 run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 0.75
execute if score .time_setting settings matches 2 run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1
execute if score .time_setting settings matches 3 run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1.25
execute if score .time_setting settings matches 4 run playsound minecraft:block.note_block.bit player @s ~ ~ ~ 1 1.5