I did it and it worked, but the problem now is that using pbTrainerName ("x") it removes the trainer card, the pokédex and some other elements when it comes to returning my old name.Just save it to a global variable, then refer back to the variable when you need the name again.
Yes! It's works! Thank you!try altering the trainer name like this:
Code:$Trainer.name = "new name"