function CheckPassword():boolean{ is void?

so part of my script is:

if(networkView.RPC("CheckPassword", RPCMode.Server, Username,Password)){
Application.LoadLevel(1);
} else {
ImWrong=true;
}

then my function looks like this:

@RPC
function CheckPassword(User: String, Pass:String):boolean{
if(Network.isServer){
LoginPass=PlayerPrefs.GetString(User,"Pass");
if(LoginPass==Pass)
return true;
else
return false;
}
}

but i get an error saying

Assets/LoginScript.js(30,19): BCE0026: 'void' cannot be used in a boolean context.

is there a way to set the value of CheckPassword to false before its called? or is there a different way to fix this problem

No, that would mean your application would have to hang until the RPC returned a value (which can't happen).

The usual way to do this is like this:

client->server     Login(user, pass)
server->client     AllowLogin() or DenyLogin() depending on credentials

Alternatively, you could have a single function for the return which takes a bool - either way, it needs to be one message to server, and one message back