Mr.S Posted September 6, 2008 Report Share Posted September 6, 2008 I need bit of help for a code. If a player hold F1 and presses Enter a object has its vspeed set to 3. Simple heres my code: if((keyboard_check_pressed(vk_f1)and keyboard_check_released(vk_enter))){ //Platform starts moving up vspeed = 3; } Theres my code but nothing happends. What could be the problem. Link to comment Share on other sites More sharing options...
Kain Posted September 6, 2008 Report Share Posted September 6, 2008 keyboard_check_pressed checks only if you just pressed the button.If you are holding it down, it will not continue to return true. And keyboard_check_released checks only if you just released it. And so the only way to activate this code is to hold down enter, then release enter and press F1 at the EXACT same time. I believe the code you want is: if((keyboard_check(vk_f1)and keyboard_check_pressed(vk_enter))){ //Platform starts moving up vspeed = 3; } Link to comment Share on other sites More sharing options...
Recommended Posts