How do I cap jumping?

I have made a script for a ball that rolls around. I have now added a jump function and I wanted to know how to cap it so the player doesn’t fly around. I am very new and would like to know how would I go about doing this. The script is as follows: