I can't jump after jumping once.,Won't jump after one jump

I can’t jump after jumping once, here is my code, please help:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Jump : MonoBehaviour
{
    public Rigidbody rb;
    public bool IsGrounded = true;
    public float groundDist;
    public bool Israycastgrounded = true;
    public bool Isdoubleraycastgrounded = true;
    public bool Istripleraycastgrounded = true;
    public Vector3 raycastoffset = new Vector3(0, 0, 0.5f);
    // Start is called before the first frame update
    void Start()
    {
        groundDist = GetComponent<Collider>().bounds.extents.y;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) && IsGrounded && Israycastgrounded && Isdoubleraycastgrounded && Istripleraycastgrounded) {

            GetComponent<Rigidbody>().AddForce(transform.up * 7, ForceMode.Impulse);
            IsGrounded = false;
            Israycastgrounded = false;
            Isdoubleraycastgrounded = false;
            Istripleraycastgrounded = false;
        }
        if (!Physics.Raycast(transform.position, -Vector3.up, groundDist + 5)) {
            Israycastgrounded = false;
            print("no");
        }
        else {
            Israycastgrounded = true;
            print("yes");
        }
        if (!Physics.Raycast(transform.position - raycastoffset, -Vector3.up, groundDist + 5)) {
            Isdoubleraycastgrounded = false;
            print("no1");
        }
        else {
            Isdoubleraycastgrounded = true;
            print("yes1");
        }
        if (!Physics.Raycast(transform.position + raycastoffset, -Vector3.up, groundDist + 5))
        {
            Istripleraycastgrounded = false;
            print("no2");
        }
        else
        {
            Istripleraycastgrounded = true;
            print("yes2");

        }
        void OnCollisionEnter(Collision collision) {
            if (collision.gameObject.name == "Ground" || collision.gameObject.name == "Platform") {
                IsGrounded = true;
            }
        }
    } }

,Whenever I jump it stops letting me jump, please help.
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Jump : MonoBehaviour
{
    public Rigidbody rb;
    public bool IsGrounded = true;
    public float groundDist;
    public bool Israycastgrounded = true;
    public bool Isdoubleraycastgrounded = true;
    public bool Istripleraycastgrounded = true;
    public Vector3 raycastoffset = new Vector3(0, 0, 0.5f);
    // Start is called before the first frame update
    void Start()
    {
        groundDist = GetComponent<Collider>().bounds.extents.y;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) && IsGrounded && Israycastgrounded && Isdoubleraycastgrounded && Istripleraycastgrounded) {

            GetComponent<Rigidbody>().AddForce(transform.up * 7, ForceMode.Impulse);
            IsGrounded = false;
            Israycastgrounded = false;
            Isdoubleraycastgrounded = false;
            Istripleraycastgrounded = false;
        }
        if (!Physics.Raycast(transform.position, -Vector3.up, groundDist + 5)) {
            Israycastgrounded = false;
            print("no");
        }
        else {
            Israycastgrounded = true;
            print("yes");
        }
        if (!Physics.Raycast(transform.position - raycastoffset, -Vector3.up, groundDist + 5)) {
            Isdoubleraycastgrounded = false;
            print("no1");
        }
        else {
            Isdoubleraycastgrounded = true;
            print("yes1");
        }
        if (!Physics.Raycast(transform.position + raycastoffset, -Vector3.up, groundDist + 5))
        {
            Istripleraycastgrounded = false;
            print("no2");
        }
        else
        {
            Istripleraycastgrounded = true;
            print("yes2");

        }
        void OnCollisionEnter(Collision collision) {
            if (collision.gameObject.name == "Ground" || collision.gameObject.name == "Platform") {
                IsGrounded = true;
            }
        }
    } }

@blazegs2008

Hello!

I use this code to jump

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
    private Rigidbody playerRB;
    public float jumpForce = 10;
    public float gravityModifier;
    public bool isOnGround = true;
    // Start is called before the first frame update
    void Start()
    {
        playerRB = GetComponent<Rigidbody>();
        Physics.gravity *= gravityModifier;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.Space) && isOnGround)
        {      
            playerRB.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
            isOnGround = false;
        }
    }
    private void OnCollisionEnter(Collision collision)
    {
        isOnGround = true;
    }
}

It is very simple and easy.

Nevermind I changed it back, but when I use raycast, when I am at the end of a platform, I can’t jump