# Displayng correct page
execute as @s[scores={men_cos=1}] run function subchronos:lobby/menu/pag_1
execute as @s[scores={men_cos=2}] run function subchronos:lobby/menu/pag_2
execute as @s[scores={men_cos=3}] run function subchronos:lobby/menu/pag_3
execute as @s[scores={men_cos=4}] run function subchronos:lobby/menu/pag_4

# Reset page if you go
execute positioned 534.5 101 -996.5 run scoreboard players set @s[distance=6..20] men_cos 1
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s men_cos matches 1.. run scoreboard players set @s men_cos 1

# Set stats 0 if u dont have
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s statsWins matches 0.. run scoreboard players set @s statsWins 0
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s statsDeaths matches 0.. run scoreboard players set @s statsDeaths 0
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s statsGames matches 0.. run scoreboard players set @s statsGames 0
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s statsKills matches 0.. run scoreboard players set @s statsKills 0
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s shield_type matches 1.. run scoreboard players set @s shield_type 1
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s cage_type matches 1.. run scoreboard players set @s cage_type 1
execute positioned 534.5 101 -996.5 as @s[distance=..10] unless score @s arrow_type matches 1.. run scoreboard players set @s arrow_type 1

# Clear trash items
clear @s *[custom_data={trash:1b}]
clear @s *[custom_data={menu:1,trash:1b}]

