Only Jumping once

I know there are a lot of fourms about this but none of them helped. I want my character to only jump once but I cannot use a character controller because it doesnt work for me here is my code `using UnityEngine;
using System.Collections;

public class PlayerMovingScript : MonoBehaviour {

public float Acceleration = 10;
public float maxSpeed = 10;
public Vector3 jumpSpeed;




// Use this for initialization
void Start () {

}


// Update is called once per frame
void Update () {
{

if(transform.position.y > 2 && Input.GetButtonDown("Jump") )

rigidbody.AddRelativeForce (jumpSpeed, ForceMode.VelocityChange);

}


var curSpeed = rigidbody.velocity;
curSpeed.y = 0;


if(curSpeed.magnitude < maxSpeed)
rigidbody.AddRelativeForce(Acceleration,0,0);


}

}
`

You can control it with a bool var:

bool canJump = true;

and you can check it before applies the force:

if(canJump && transform.position.y > 2 && Input.GetButtonDown("Jump") ) {
    canJump = false;
    rigidbody.AddRelativeForce (jumpSpeed, ForceMode.VelocityChange); 
}

Set it back to true when the rigidbody hit the ground again or whenever you want to allow the object to jump.