Hitting zero with a button

I’m using mx2004, and here is my issue…
I have 2 variables, craft and avilablepoints, now when you hit the crafting button, it subtracts 1 point from avilablepoints, and adds 1 to the craft variable. I got that coded without an issue. I’m having trouble setting up the button to stop adding when availablepoints hits zero. What should I do?
Here is the code I have so far…

on(release) {
craft++;
avpoints–;
}

I had more code, but nothing worked for me.
Any suggestions?