execute @a[tag=Lobby,score_UseSnowball_min=1] ~ ~ ~ summon minecraft:area_effect_cloud ~ ~ ~ {CustomName:"Secret",NoGravity:1b,Marker:1b,Invisible:0b,Duration:200}
execute @a[tag=LobbyAFK,score_UseSnowball_min=1] ~ ~ ~ summon minecraft:area_effect_cloud ~ ~ ~ {CustomName:"Secret",NoGravity:1b,Marker:1b,Invisible:0b,Duration:200}
execute @a[tag=LobbySpectate,score_UseSnowball_min=1] ~ ~ ~ summon minecraft:area_effect_cloud ~ ~ ~ {CustomName:"Secret",NoGravity:1b,Marker:1b,Invisible:0b,Duration:200}
execute @a[tag=Lobby,score_UseSnowball_min=1] ~ ~ ~ scoreboard players tag @e[type=snowball,r=2,c=1] add TpSpawnLobby
execute @a[tag=LobbyAFK,score_UseSnowball_min=1] ~ ~ ~ scoreboard players tag @e[type=snowball,r=2,c=1] add TpSpawnLobby
execute @a[tag=LobbySpectate,score_UseSnowball_min=1] ~ ~ ~ scoreboard players tag @e[type=snowball,r=2,c=1] add TpSpawnLobby
execute @a[tag=Lobby,score_UseSnowball_min=1] ~ ~ ~ scoreboard players operation @e[name=Secret,type=area_effect_cloud,r=2,c=1] LobbySnowballAir = @s LobbySnowball
execute @a[tag=LobbyAFK,score_UseSnowball_min=1] ~ ~ ~ scoreboard players operation @e[name=Secret,type=area_effect_cloud,r=2,c=1] LobbySnowballAir = @s LobbySnowball
execute @a[tag=LobbySpectate,score_UseSnowball_min=1] ~ ~ ~ scoreboard players operation @e[name=Secret,type=area_effect_cloud,r=2,c=1] LobbySnowballAir = @s LobbySnowball
scoreboard players reset @a[score_UseSnowball_min=1,tag=Lobby] UseSnowball
scoreboard players reset @a[score_UseSnowball_min=1,tag=LobbyAFK] UseSnowball
scoreboard players reset @a[score_UseSnowball_min=1,tag=LobbySpectate] UseSnowball


execute @e[tag=TpSpawnLobby,type=snowball] ~ ~ ~ particle fallingdust ~ ~ ~ 0.1 0.1 0.1 1 1 1 @a 80
execute @e[tag=TpSpawnLobby,type=snowball] ~ ~ ~ particle fallingdust ~ ~ ~ 0.1 0.1 0.1 1 10 1 @a 79
execute @e[tag=TpSpawnLobby,type=snowball] ~ ~ ~ teleport @e[name=Secret,type=area_effect_cloud,c=1] ~ ~ ~

scoreboard players tag @e[name=Secret,type=area_effect_cloud] add TestForSnowballLobby
execute @e[tag=TpSpawnLobby,type=snowball] ~ ~ ~ scoreboard players tag @e[name=Secret,type=area_effect_cloud,c=1] remove TestForSnowballLobby
#=======#
execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ scoreboard players tag @a[c=1,r=3,tag=!AFK] add InitLobbyTouched
execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ execute @a[tag=InitLobbyTouched] ~ ~ ~ scoreboard players operation @s[tag=LobbySnowball] LobbySnowball -= @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud,c=1,r=3] LobbySnowballAir
execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ scoreboard players tag @a[tag=InitLobbyTouched,score_LobbySnowball_min=0,score_LobbySnowball=0] remove InitLobbyTouched
execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ scoreboard players operation @a[tag=LobbySnowball,score_LobbySnowball_min=0,score_LobbySnowball=0] LobbySnowball += @s LobbySnowballAir
execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ execute @a[tag=InitLobbyTouched] ~ ~ ~ scoreboard players operation @s[tag=LobbySnowball] LobbySnowball += @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud,c=1,r=3] LobbySnowballAir
execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ scoreboard players tag @a[tag=InitLobbyTouched] add LobbyTouched
execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ scoreboard players tag @a[tag=InitLobbyTouched] remove InitLobbyTouched
execute @a[tag=LobbyTouched] ~ ~ ~ execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ scoreboard players operation @a[tag=LobbySnowball] LobbySnowball -= @s LobbySnowballAir
execute @a[tag=LobbyTouched] ~ ~ ~ scoreboard players tag @a[tag=LobbySnowball,score_LobbySnowball_min=0,score_LobbySnowball=0] add Touched
execute @a[tag=LobbyTouched] ~ ~ ~ execute @e[tag=TestForSnowballLobby,name=Secret,type=area_effect_cloud] ~ ~ ~ scoreboard players operation @a[tag=LobbySnowball] LobbySnowball += @s LobbySnowballAir
execute @a[tag=LobbyTouched] ~ ~ ~ scoreboard players add @a[tag=Touched] LobbyTouched 1
scoreboard teams leave @a[tag=LobbyTouched]
execute @a[tag=LobbyTouched] ~ ~ ~ execute @a[tag=Touched] ~ ~ ~ title @s times 0 30 10
execute @a[tag=LobbyTouched] ~ ~ ~ execute @a[tag=Touched] ~ ~ ~ title @s title {"text":""}
execute @a[tag=LobbyTouched] ~ ~ ~ execute @a[tag=Touched] ~ ~ ~ title @s subtitle ["",{"text":"You touched ","color":"aqua"},{"selector":"@a[tag=LobbyTouched]","bold":true,"color":"dark_aqua"},{"text":"! ","color":"aqua"},{"text":"(total touched: ","italic":true,"color":"aqua"},{"score":{"name":"@s","objective":"LobbyTouched"},"italic":true,"color":"dark_aqua"},{"text":")","italic":true,"color":"aqua"}]
function main:scoreboard/snowballleaderboard if @a[tag=Touched]
scoreboard players tag @a[tag=Touched] remove Touched
#=======#
execute @a[tag=LobbyTouched] ~ ~ ~ summon fireworks_rocket ~ ~1 ~ {FireworksItem:{id:fireworks,Count:1,tag:{Fireworks:{Explosions:[{Type:0,Colors:[I;4585983],FadeColors:[I;4585983]},{Type:0,Colors:[I;16777215],FadeColors:[I;16777215]}]}}}}
tp @a[tag=LobbyTouched] 500 170 500 ~ 90
scoreboard players set @a[tag=LobbyTouched,score_AFKTimer_min=1,score_AFKTimer=3] AFKTimer 4
scoreboard players tag @a[tag=LobbyTouched] remove LobbyAFKBar
scoreboard players tag @a[tag=LobbyTouched] remove LobbyAFKHowToPlay
scoreboard players tag @a[tag=LobbyTouched] remove LobbyAFKTesterRoom
scoreboard players tag @a[tag=LobbyTouched] remove LobbyTouched
kill @e[tag=TestForSnowballLobby,type=area_effect_cloud]