#=== Initialisation ===#
scoreboard players tag @a[tag=Ending] add DisconnectedDuringGame
scoreboard players tag @a[tag=Starting] add DisconnectedDuringGame
scoreboard players tag @a[tag=InGame] add DisconnectedDuringGame
scoreboard players tag @a[tag=Spectator] add DisconnectedDuringGame
#=== Reset ===#
scoreboard players reset @a[tag=DisconnectedDuringGame] FocusedSince
scoreboard players reset @a[tag=DisconnectedDuringGame] NotFocusedSince
scoreboard players reset @a[tag=DisconnectedDuringGame] FreezedSince
scoreboard players reset @a[tag=DisconnectedDuringGame] TimerFreezed
scoreboard players reset @a[tag=DisconnectedDuringGame] Resurrecting
scoreboard players reset @a[tag=DisconnectedDuringGame] Murder
scoreboard players reset @a[tag=DisconnectedDuringGame] IceNumber
scoreboard players reset @a[tag=DisconnectedDuringGame] Disconnect
scoreboard players reset @a[tag=DisconnectedDuringGame] AFKTimer
execute @a[tag=DisconnectedDuringGame] ~ ~ ~ trigger GoBackToLobby set 2
scoreboard players reset @a[tag=DisconnectedDuringGame] GoBackToLobby
execute @a[tag=DisconnectedDuringGame] ~ ~ ~ trigger SpecClickReset set 2
scoreboard players reset @a[tag=DisconnectedDuringGame] SpecClickReset
scoreboard players tag @a[tag=DisconnectedDuringGame] remove Innocent
scoreboard players tag @a[tag=DisconnectedDuringGame] remove Murder
scoreboard players tag @a[tag=DisconnectedDuringGame] remove Freezed
scoreboard players tag @a[tag=DisconnectedDuringGame] remove SpawnAI
scoreboard players tag @a[tag=DisconnectedDuringGame] remove StartInit
scoreboard players tag @a[tag=DisconnectedDuringGame] remove SelectedTp
scoreboard players tag @a[tag=DisconnectedDuringGame] remove MurderInit
scoreboard players tag @a[tag=DisconnectedDuringGame] remove StopFocusing
scoreboard players tag @a[tag=DisconnectedDuringGame] remove BeingRescued
scoreboard players tag @a[tag=DisconnectedDuringGame] remove NeedTp
scoreboard players tag @a[tag=DisconnectedDuringGame] remove Spectator
scoreboard players tag @a[tag=DisconnectedDuringGame] remove Voted
scoreboard players tag @a[tag=DisconnectedDuringGame] remove Ending
scoreboard players tag @a[tag=DisconnectedDuringGame] remove Starting
scoreboard players tag @a[tag=DisconnectedDuringGame] remove InGame
#=== InBoat ===#
execute @a[tag=DisconnectedDuringGame] ~ ~ ~ tp @s[tag=InBoat] ~ ~ ~

execute @a[tag=DisconnectedDuringGame] ~ ~ ~ execute @s[tag=InBoat] ~ ~ ~ kill @e[type=armor_stand,name=ArmorRun,c=1]
execute @a[tag=DisconnectedDuringGame] ~ ~ ~ execute @s[tag=InBoat] ~ ~ ~ kill @e[type=area_effect_cloud,name=BoatPassenger,c=1]
execute @a[tag=DisconnectedDuringGame] ~ ~ ~ execute @s[tag=InBoat] ~ ~ ~ kill @e[type=boat,name=BoatRun,c=1]

scoreboard players reset @a[tag=DisconnectedDuringGame] InBoat
scoreboard players tag @e[tag=DisconnectedDuringGame] remove InBoat
#=== Readjusts ===#
gamemode 2 @a[tag=DisconnectedDuringGame]
clear @a[tag=DisconnectedDuringGame]
spreadplayers 500 500 0 5 false @a[tag=DisconnectedDuringGame]
scoreboard players tag @a[tag=DisconnectedDuringGame] add Lobby
effect @a[tag=DisconnectedDuringGame] clear
scoreboard players tag @a[tag=DisconnectedDuringGame] remove DisconnectedDuringGame