How do I fix this Parsing Error (EASY)

Why is this script returning a parsing error.

public int currentscene2 = 7;
public int hasminer;
public string hasmine;

void Update()
{
hasminer = PlayerPrefs.GetInt("BoughtMiner");
hasmine = PlayerPrefs.GetString("HasMine")
}


//The error happens in this function.
public void CheckForMiner()
	{
		if (hasminer = 1) {
			
		
			if (hasmine == ("Yes") 
			{
				currentscene2 = 4;
		}
		
		else {
		currentscene2 = 3;
		}	

		}

				}

public int currentscene2 = 7;
public int hasminer;
public string hasmine;

 void Update()
 {
 hasminer = PlayerPrefs.GetInt("BoughtMiner");
 hasmine = PlayerPrefs.GetString("HasMine");
 }
 
 
 //The error happens in this function.
 public void CheckForMiner()
     {
         if (hasminer == 1) {
             
         
             if (hasmine == "Yes") 
             {
                 currentscene2 = 4;
         }
         
         else {
         currentscene2 = 3;
         }    
 
         }
 
                 }
  • Is this the whole script? There‚Äôs no class definition or using directives.
  • Your variable names are horrible - hasmine(string) and hasminer(int), both of which appear to actually be Bools anyway, and currentScene2???!
  • Line 8 is missing a closing semicolon. Should be hasmine = PlayerPrefs.GetString("HasMine");
  • Line 15 has an assignment rather than comparison operator. Should be if (hasminer == 1) {
  • Line 18 has an extra open bracket. Should be if (hasmine == "Yes")