Credits to all who helped me in this thread. From reading all of your tips, I was able to find the exact thing I wanted.
Here is the actual code.
Function Hide_mesh() { while (key_q == on && q_press == 0){player_mesh.invisible = on; q_press = 1;proc_late();wait(1);}
while (key_q == on && q_press== 1){player_mesh.invisible = off; q_press = 0;proc_late();wait(1);} }
Without proc_late() When pressing q it at lighting speeds goes back and forth between on and off. Which isnt what I want. Adding proc_late contained the problem and made a single press or holding the key = 1 press.