# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/team-elimination-game-3-subscribing-to-player-spawn-events-in-verse
# Local doc: epic-docs/documentation/en-us/uefn/team-elimination-game-3-subscribing-to-player-spawn-events-in-verse.md
# Section: 3. Subscribing to Player Events
OnBegin<override>()<suspends> : void =
# Get all the players
set Teams = GetPlayspace().GetTeamCollection().GetTeams()
set EliminationsToEndGame = WeaponGranters.Length
Print("Number of eliminations to end game is {EliminationsToEndGame}")
for (Spawner : PlayerSpawners):
Spawner.SpawnedEvent.Subscribe(OnPlayerSpawn) # Subscribe to each player spawn pad
Verse Library
verse
01 3 Subscribing To Player Events
Initializes game state and subscribes to all player spawner events to handle spawn logic.
extracted-snippets/documentation/en-us/uefn/team-elimination-game-3-subscribing-to-player-spawn-events-in-verse/01-3-subscribing-to-player-events.verse