![]() |
the keydown events
Could someone be kind enough to post a list of the keydown's.. like thos
0 = a or whatever each keydown numeric form corrisponds with in letters |
I mainly need the keydown's for the following buttons
Z, X, C, and V |
There are no keydowns for those buttons. These are the only ones available:
0- Up 1- Left 2- Down 3- Right 4- D 5- S 6- A 7- M 8- Tab 9- Q 10- P |
Ugh, that sucks.. well thanks anyway =)
|
Ok so tell me then, why don't this work?
if (playery=>6&&keydown(5)) { playerdir=up; playery=playery-0.5; } |
well
it should be
playerdir=0; |
Ok i tried...
if (playery=>6&&keydown(5)) { playerdir=0; playery=playery-0.5; } but it still don't work.. what it's suppose to be doing is move the player up by 0.5 notches every time they press S |
need a Timeout in there :)
NPC Code: note: you can substitute playerenters with anyother thing you want... |
Ok thanks, i got it working, but one thing still isn't right.. the player can just hold down the button and move up, i want them to have to repeatedly press the button so the faster the press it the faster they move, and the slower the press it the slower they move. i'd post what i have, but i don't want anyone to steal it =)
|
to check if they have the keyup
ok to check if they have the key up do something like this
NPC Code: |
Ok i added that and it still didn't work, you can just hold down the button and move =(
|
humm I dunno
I dunno...
oh.. do you disabledefmovement? so they cant hold up... so they have to press the button... |
yep i done that, lol
|
I would...
I dunno I would have to see your script
|
if(keydown(5)){
if(this.keydown==0){ this.keydown=1; ... } }else this.keydown=0; |
that shouldn't
that shouldn't matter if it says
elseif or if |
if you want it to be the more you press the faster it goes..
like if you keep pressing it really fast then I suggest you do some sort of speed string .. which adds +.5 or whatever every time the player has the key down and has a max value .. like 3 or whatever.. and also it would have to take out .5 when there is no key down shouldnt be hard to make. I'd do it but I'm too lazy, too busy and sun burn hurts |
actually it does matter with else...
basicly without else, it will do everything instantly.... for istance try doing weapon fired, and making it go something like: if (weaponfired) { if (this.on = 1) { this.on = 0; }else{ if (this.on = 0) { this.on = 1; } } } then have another going: if (weaponfired) { if (this.on = 1) { this.on = 0; } if (this.on = 0) { this.on = 1; } } and you will see what i mean ;-) |
| All times are GMT +2. The time now is 08:43 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.