Code(error)

Hi! I am beginner to unity.I found the following error in file GameGUI.js:
error:“void” can not be used in boolean context.

thnx…!

code:

if(OldScore < NewScore)
	{
		PlayerPrefs.SetInt(GameControl.GetInstance().BEST_SCORE_KEY, NewScore);
		if(CheckInternet())//   Here is I think error
		{
			
			StartCoroutine("SendScore", SystemInfo.deviceUniqueIdentifier);
		}
//		LeaderBoardsManager.Instance.PostScore(NewScore);
	}

I think you’ve isolated the right line. An if statement works like this:

if(somethingIsTrue) { doThis(); }

What the error message is telling you is that “CheckInternet()” is not true (or false), because it doesn’t return any value. So it can’t be used as the condition in an if statement. The method signature probably looks like:

void CheckInternet() { ... }

When it needs to look like:

Bool CheckInternet() { //code to return true if the internet is working }