Single Jump Script w/ Joystick addition

This is the current working code. I need to have the jump script only jump once. Right now, you jump an infinite amount of times. Keep in mind, I am a beginner. Thank you!
.
.
.

using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using UnityEngine;
using UnityEngine.InputSystem;
using TMPro;

public class JoyControl : MonoBehaviour
{
protected Joystick joystick;
protected Joybutton joybutton;

protected bool jump;

public TextMeshProUGUI countText;
public GameObject winTextObject;
private int count;

// Start is called before the first frame update
void Start()
{
    joystick = FindObjectOfType<Joystick>();
    joybutton = FindObjectOfType<Joybutton>();

    count = 0;
    SetCountText();
    winTextObject.SetActive(false);
}

void SetCountText()
{
    countText.text = "Count: " + count.ToString();
    if (count >= 5)
    {
        winTextObject.SetActive(true);
    }
}

// Update is called once per frame
void Update()
{
    var rigidbody = GetComponent<Rigidbody>();
    rigidbody.velocity = new Vector3(joystick.Horizontal * 12f, rigidbody.velocity.y, joystick.Vertical * 12f);

    if (!jump && joybutton.Pressed)
    {
        jump = true;
        rigidbody.velocity += Vector3.up * 5f;
    }

    if (jump && !joybutton.Pressed)
    {
        jump = false;
    }
}
private void OnTriggerEnter(Collider other)
{
    if (other.gameObject.CompareTag("PickUp"))
    {
        other.gameObject.SetActive(false);
        count = count + 1;

        SetCountText();
    }
}

}

Hey!

Not at home right now so can’t write a lengthy answer, but what you need is a “groundcheck”. Basically checking if the character is connected to ground, and add logic in your jump not to allow for jumps if not connected to ground. Here’s a link:

You can google "unity groundcheck" if you don't think the link is helpful/your style :)