Different messages appear

Hello.How can I make , when the caracter dies,when the level is restarted ,at the beggining of the Level,acoperă different messages each time.
Like when I die first time to show up a messages like “You try again” , next time when i restart " still trying" etc.
Please help and thank you

You can record this infos somewhere, like the game instance, for example, on gameinstance you can have a Integer variable named “Deaths”, everytime you die you increase one death on this variable.
Now on the UI code, you can check the variable to define your message.
If Deaths > X
Message = Still trying…

This would well if stored in a Game Instance.

If you do not care about different message every time, you can have an array of messages pretty much anywhere and pick one with a Random Int