Teleport randomly to one of three teleporters after kill

InstantRespawn := class(creative_device):

    respawnposition: vector3=vector3{X:= 250.00, Y:= 0.01, Z:= 161.9}

    @editable
    ElimMachine : elimination_manager_device = elimination_manager_device{}
    @editable TeleportersTeam1 : []teleporter_device = array{}
    @editable TeleportersTeam2 : []teleporter_device = array{}

    NowRespawn(Agent: agent)<suspends>:void=
        Sleep(0.1)
        Agent.Respawn(respawnposition, rotation{})
        Random := GetRandomInt(0,5)

        if (Teleporter := TeleportersTeam1[Random]):
            Teleporter.Teleport(Agent)
        
        if (Teleporter := TeleportersTeam2[Random]):
            Teleporter.Teleport(Agent)

    SelfEliminated(Agent:agent):void=
        spawn{NowRespawn(Agent)}

    OnBegin<override>()<suspends>:void=
        ElimMachine.EliminatedEvent.Subscribe(SelfEliminated)