Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[GM] Button Help


Mr.S

Recommended Posts

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...