Please help with this code!!

I am making a multiplayer game. When I play the game, a GUI button should say connect but it doesn’t. I have two codes, one is working, the other is getting this error WELL I AM PLAYING.
Failed Network.Instantiate because we are not connected.
UnityEngine.Network:Instantiate(Object, Vector3, Quaternion, Int32)
SpawnManager:OnGUI() (at Assets/Scripts/MultiPlayer/SpawnManager.js:34)

Here is my Spawn script.

 #pragma strict

var Connection : boolean = false;
var RedPlayer : GameObject;
var BluePlayer : GameObject;
var CurTeam : String = "";
var Dead : boolean = true;
var SpawnPointRed : GameObject;
var SpawnPointBlue : GameObject;

var CenterW : float;
var CenterH : float;

function Start ()
{
	CurTeam = "";
	CenterW = Screen.width/2 - 150;
	CenterH = Screen.height/2 - 80;
}


function OnGUI () 
{
if(Network.peerType == NetworkPeerType.Disconnected)
{
	Connection = false;
}
else
{
	Connection = true;
}
if(Connection == true)
{
GUI.Box(Rect(CenterW, CenterH, 300, 160), "Select a Team");
	if(CurTeam == "Red")
	{	
		if(GUI.Button(Rect(CenterW + 5, CenterH + 20, 290, 65),"Red Team"))
	{
		Network.Instantiate(RedPlayer, SpawnPointRed.transform.position, transform.rotation, 0);
		Dead = false;
	}
	if(GUI.Button(Rect(CenterW + 5, CenterH + 90, 290, 65),"Blue Team"))
	{
		Network.Instantiate(BluePlayer, SpawnPointBlue.transform.position, transform.rotation, 0);
		CurTeam = "Blue";	
		Dead = false;
		}
	}
	else
	{
		if(GUI.Button(Rect(CenterW + 5, CenterH + 20, 290, 130),"Respawn"))	
		{
			if(CurTeam == "Red")
			{
				Network.Instantiate(RedPlayer, SpawnPointRed.transform.position, transform.rotation, 0);
				Dead = false;
			}
			if(CurTeam == "Blue")
		{
			Network.Instantiate(BluePlayer, SpawnPointBlue.transform.position, transform.rotation, 0);	
		Dead = false;		
		}
		}
		
		}
}
}

and here is my DirectConnection Script.

#pragma strict

var remoteIPadress = "127.0.1";
var remotePort = 25000;
var listenPort = 25000;


var useNAT = true;

var myIP = "";
var myPort = "";

var MaxPlayers = 32;

function OnConnectedToServer()
{
	
}

function OnDisconnectedFromServer()
{
	
}

function onGUI ()
{
	
	if(Network.peerType == NetworkPeerType.Disconnected)
	{
		if(GUI.Button(Rect(5,5,150,30),"Connect"))
		{
			Network.useNat = useNAT;
			Network.Connect(remoteIPadress, remotePort);
		}
		if(GUI.Button(Rect(5,40,60,30),"StartServer"))
		{
			Network.useNat = useNAT;
			Network.InitializeServer(MaxPlayers, listenPort);
		}
		
		remoteIPadress = GUI.TextField(Rect(5, 75, 60, 30), remoteIPadress);
		remotePort = parseInt(GUI.TextField(Rect(5, 110, 60, 30), remotePort.ToString()));
			
	}
	else
	{
		if(GUI.Button(Rect(5,5,150,30),"Disconnect"))
		{
			Network.Disconnect(200);
		}
	}

}

PLEASE HELP!!!

Line 25 in DirectConnection should have OnGUI, not onGUI. CASE MATTERS