Error BCE0034

I was working on my pause menu and I got some errors but Someone helped me fix them…but now I have a different error.

Assets/scripts/Pause Menu.js(27,12): BCE0034 : Expressions in statements must only be executed for their side-effects

The whole script is:

#pragma strict

var PauseGUI : GUIText;
var paused : boolean = false;

private var FPSInputController : FPSInputController;
private var MouseLook : MouseLook;
private var CharacterMotor : CharacterMotor;
private var Player : Player;

function Start ()
{
	
	paused = false;
	Time.timeScale = 1;
	PauseGUI.enabled =  false;
	FPSInputController.enabled = true;
	MouseLook.enabled = true;
	Player.enabled = true;
	CharacterMotor.enabled = true;
}
	
function Update ()
    {
    if (Input.GetKeyDown("p"))
    {
    paused != paused;
    if(paused){
    Time.timeScale = 0;
    PauseGUI.enabled = true;
    FPSInputController.enabled = false;
    MouseLook.enabled = false;;
    CharacterMotor.enabled = false;;
    Player.enabled = false;}
    else{
    Time.timeScale = 1;
    PauseGUI.enabled = false;
    FPSInputController.enabled = true;
    MouseLook.enabled = true;
    CharacterMotor.enabled = true;
    Player.enabled = true;}
    }
}

THANKS IN ADVANCE!

Line 27 should be:

 paused = !paused;

The way you have it now, you are doing a boolean comparison, but you are not storing the result.

The error seems to be that ‘paused != paused;’ isn’t allowed in Javascript.

Please try this instead:

#pragma strict
 
var PauseGUI : GUIText;
var paused : boolean = false;
 
private var FPSInputController : FPSInputController;
private var MouseLook : MouseLook;
private var CharacterMotor : CharacterMotor;
private var Player : Player;
 
function Start ()
{
 
    paused = false;
    Time.timeScale = 1;
    PauseGUI.enabled =  false;
    FPSInputController.enabled = true;
    MouseLook.enabled = true;
    Player.enabled = true;
    CharacterMotor.enabled = true;
}
 
function Update ()
    {
    if (Input.GetKeyDown("p"))
    {
    paused = !paused;
    if(paused){
    Time.timeScale = 0;
    PauseGUI.enabled = true;
    FPSInputController.enabled = false;
    MouseLook.enabled = false;;
    CharacterMotor.enabled = false;;
    Player.enabled = false;}
    else{
    Time.timeScale = 1;
    PauseGUI.enabled = false;
    FPSInputController.enabled = true;
    MouseLook.enabled = true;
    CharacterMotor.enabled = true;
    Player.enabled = true;}
    }
}