Infinite jump

My player can jump while in the air. Which means im sort of flying around.
What is wrong with this script:

using UnityEngine;
using System.Collections;

public class PlayerMovement : MonoBehaviour
{

//Movement
public float speed;
public float jump;
float moveVelocity;

//Grounded Vars
bool isGrounded = false;

void Update () 
{
    //Jumping
    if (Input.GetKeyDown (KeyCode.Space) || Input.GetKeyDown (KeyCode.UpArrow) || Input.GetKeyDown (KeyCode.Z) || Input.GetKeyDown (KeyCode.W)) 
    {
        if(isGrounded)
        {
            GetComponent<Rigidbody2D> ().velocity = new Vector2 (GetComponent<Rigidbody2D> ().velocity.x, jump);
        }
    }

    moveVelocity = 0;

    //Left Right Movement
    if (Input.GetKey (KeyCode.LeftArrow) || Input.GetKey (KeyCode.A)) 
    {
        moveVelocity = -speed;
    }
    if (Input.GetKey (KeyCode.RightArrow) || Input.GetKey (KeyCode.D)) 
    {
        moveVelocity = speed;
    }

    GetComponent<Rigidbody2D> ().velocity = new Vector2 (moveVelocity, GetComponent<Rigidbody2D> ().velocity.y);

}
//Check if Grounded

void OnCollisionEnter(Collider other){
if(other.tag == “ground”){
isGrounded = true;
}
}

void OnCollisionExit(Collider other){
if(other.tag == “ground”){
isGrounded = false;
}
}
},

Make sure that your oncollisionenter and exit are actually calling, try putting a debug.log in them to see if they actually change isGrounded. Also check that tags are properly placed to the ground object. You could also get rid of onCollisionExit and set isGrounded to false after the jump.

@IvanC314 is correct, seems like the problem lies with your OnCollisionEnter/Exit code not being called corectly. as the isGrounded is not being set to false, which means you can keep on jumping.

You could also add an invisible sphere under your player and have a script with OnCollisionEnter/Exit and have it invoke a delegate in your movement script.