Max Level reached ever

I make a game with more levels. (50). In my main menu is an option ChooseLevel. When you can tipe in a InputField a level number and that level will start.
I want to show in a GUIText an error message if the level number is less than the max level ever reached.
Like i play up to level 20 and when i type in InputField 30 to show a msg “This level is locked”.

I think you are looking for PlayerPrefs, which will allow you to store the highest level that your player ever completes.

For instance you might have some function in your gameplay manager:

//This would perhaps be called from BroadcastMessage() or something elsewhere in your game
public void OnLevelComplete() {
    PlayerPrefs.SetInt("HighestLevelAchieved", this.myLevelId);

Then when you need to check…

public bool IsLevelAvailable(int n) {
   return n >= 0 && n <= PlayerPrefs.GetInt("HighestLevelAchieved", 0);

So now you can easily determine whether the level is unlocked or not.

If you’re asking about the GUI stuff you should fix your question.