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

function f:lobby/unload
execute as @e[tag=stats_player] run data merge entity @s {CustomName:'{"text":"N/A","italic":true,"color":"gray"}'}
scoreboard players set @e[tag=stats_player] main 0
kill @e[tag=database]
tag @a remove registered
scoreboard objectives remove wins
scoreboard objectives remove kills
scoreboard objectives remove pumpkins
scoreboard objectives add wins dummy
scoreboard objectives add kills dummy
scoreboard objectives add pumpkins dummy
scoreboard players set option_time pumpkins -2
scoreboard players set $game_type main 0

fill 320 107 -348 318 109 -348 minecraft:iron_trapdoor[open=true]
fill 318 108 -347 320 108 -347 minecraft:trapped_chest{Lock:"123"}
execute as @e[tag=game_start_locked] run data merge entity @s {CustomNameVisible:1}
scoreboard players reset @a
advancement revoke @a everything
tag @a remove info_classic
tag @a remove info_ctp
tag @a remove info_deathmatch
tag @a remove info_hide_and_seek
tag @a remove test