# Response from main game
execute as @s[team=lobby] run tellraw @s [{"text":" Already in lobby","color":"red"},{"text":"!","color":"gray"}]
execute as @s[team=pvp] run title @s actionbar [{"text":"Returning to lobby","color":"white"},{"text":"...","color":"gray"}]
execute as @s[team=safe] run title @s actionbar [{"text":"Returning to lobby","color":"white"},{"text":"...","color":"gray"}]
execute as @s[team=ssz] run title @s actionbar [{"text":"Returning to lobby","color":"white"},{"text":"...","color":"gray"}]
# Plays ui toast
execute at @s run playsound ui.toast.out master @s ~ ~ ~ 1 1
# Returns player to spawn
execute as @s[team=pvp] run function ss:main/spawn
execute as @s[team=safe] run function ss:main/spawn
execute as @s[team=ssz] run function ss:zomb/spawn

# Sets gamemode and resets death timer
scoreboard players reset @s deathTimer
gamemode adventure @s

# Clears self
clear @s

# title
title @s title {"text":""}
title @s subtitle {"text":""}

# resets your response
scoreboard players reset @s leave