![]() |
Multiple KeyPresses
Can someone tell me why this won't work? And how to fix it.
I want it so you have to press all three keys for it to do the action. PHP Code:
|
The event is only called once per keypress. The variable is not going to change values midway through the function. You'd have to keep track of which keys are being pressed:
PHP Code:
|
How can I make it use a direction key too? this isn't working. And also, you have to press them one at a time til they are all pressed. You can't hit them at same time for some reason.
PHP Code:
|
You're confusing variables/methods/values and would probably benefit from reading a starting guide.
You will have to do the same thing for the arrow keys, either using their 'code' value, or ideally using keydown (so that it uses the key configured by players in the options). This is obviously not going to work: PHP Code:
Instead you'll want to keep track of when the direction keys are pressed. |
Wouldn't keydown3 on a timeout be better?
|
Quote:
PHP Code:
|
| All times are GMT +2. The time now is 10:26 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.