To look deeply into the problem of my script. It may look like that I didn't do anything wrong in the script, but the results are not what I expected.
For example, Zexacon isn't appearing, the Tyrogue he gives to the Player does not make the Pokemon menu appear... So it seems that the Player hasn't obtained any Pokemon at all.