How do you teleport a player to spawn when they win a 1v1 [duplicate]

On a kitpvp server I manage, players can duel. When they duel each other, they get teleported to a room. I'm having trouble teleporting the player back to spawn after they win. I can do it manually, but I'd rather it be automatic.


Solution 1:

I did a similar thing back in 1.12 for a small server. The way I did it was to have a command block assign each player to a different team when they start the game (using scoreboards). Then I would have 2 command blocks checking for at least 1 player on those two teams to be in a certain radius. Using gates, once any of the command blocks doesn't detect a player in a team, it runs another command block that teleports the remaining player/players back to a specific location. The players are then removed from the teams. Due to my lack of knowledge of 1.13 commands, I am unable to provide the commands that you could use for this.

I wish you luck