How to make it so my character doesn't fly away?

I put a mouse camera movement script and whenever I face up and go forward I fly into the air. I don’t want this to happen and I don’t know how I would stop this.
Here Is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerCameraMovement : MonoBehaviour {
    public float speed = 0.5f;
    public float jumpspeed = 24;
    public float speedH = 2.0f;
    public float speedV = 2.0f;
    private float yaw = 0.0f;
    private float pitch = 0.0f;
    // Use this for initialization
    void Start () {

}

    // Update is called once per frame
    void Update()
    {
        yaw += speedH * Input.GetAxis("Mouse X");
        pitch -= speedV * Input.GetAxis("Mouse Y");

        transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
        if (Input.GetKey(KeyCode.W))
        {
            transform.Translate(Vector3.forward * speed * Time.deltaTime);
        }
        if (Input.GetKey(KeyCode.S))
        {
            transform.Translate(Vector3.back * speed * Time.deltaTime);
        }
        if (Input.GetKey(KeyCode.D))
        {
            transform.Translate(Vector3.right * speed * Time.deltaTime);
        }
        if (Input.GetKey(KeyCode.A))
        {
            transform.Translate(Vector3.left * speed * Time.deltaTime);
        }
        if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            speed = speed + 4;
        }
        if (Input.GetKeyUp(KeyCode.LeftShift))
        {
            speed = speed - 4;
        }
        if (Input.GetKey(KeyCode.Space))
        {
            transform.Translate(Vector3.up * (jumpspeed / 2) * Time.deltaTime);
        }
    }
}

How do I stop this from happening?

You are rotating your object vertically with MouseLook script. MouseLook should only be at X axis. Y axis is added to the child camera attached to the player.
And don’t forget to add rigidbody to keep that thing on the ground