#Entering
scoreboard players tag @a[tag=Starting] remove HowToPlayEnter
scoreboard players tag @a[tag=HowToPlayEnter] remove Lobby
scoreboard players tag @a[tag=HowToPlayEnter] remove LobbyAFK
scoreboard players tag @a[tag=HowToPlayEnter] add LobbyAFKHowToPlay
tp @a[tag=HowToPlayEnter] 478 81 501 -90 0
execute @a[tag=HowToPlayEnter] ~ ~ ~ playsound minecraft:ui.button.click master @s ~ ~ ~

replaceitem entity @a[tag=HowToPlayEnter] slot.container.8 air
function main:scoreboard/lobby if @a[tag=HowToPlayEnter]
clear @a[tag=HowToPlayEnter] minecraft:snowball
clear @a[tag=HowToPlayEnter] minecraft:barrier
scoreboard players reset @a[tag=HowToPlayEnter] GiveSecret
scoreboard players tag @a[tag=HowToPlayEnter] remove TestforSecretItem
scoreboard players tag @a[tag=HowToPlayEnter] remove TestforSecretItem1

tellraw @a[tag=HowToPlayEnter] ["",{"text":"Freezun","color":"aqua","bold":"true"},{"text":" » ","color":"dark_gray"},{"text":"You have entered the How to Play zone. You won't be able to play the game until you leave it. ","bold":false,"color":"aqua"}]
scoreboard players tag @a[tag=HowToPlayEnter] remove HowToPlayEnter
#Leaving
scoreboard players tag @a[tag=HowToPlayExit] remove LobbyAFKHowToPlay
function main:lobby/howtoplay/testplayer if @a[tag=HowToPlayExit]
scoreboard players tag @a[tag=HowToPlayExit] add Lobby
scoreboard players tag @a[tag=LobbySpectate] remove Lobby
tp @a[tag=HowToPlayExit] 478 100 501 90 15
execute @a[tag=HowToPlayExit] ~ ~ ~ playsound minecraft:ui.button.click master @s ~ ~ ~
function main:scoreboard/lobby if @a[tag=HowToPlayExit]
tellraw @a[tag=HowToPlayExit] ["",{"text":"Freezun","color":"aqua","bold":"true"},{"text":" » ","color":"dark_gray"},{"text":"You have left the How to Play zone. You are now able to play the game. ","bold":false,"color":"aqua"}]
scoreboard players tag @a[tag=HowToPlayExit] remove HowToPlayExit