![]() |
keydown()
Is it jsut me or does keydown(#) finction not work very well?, it doesnt seem very reliable. Is there a better way?
|
so...
NPC Code: wont execute? then how do i see if a button is pressed? |
You're assuming it as an action. Unlike keypressed, where it calls the action, keydown and keydown2 are best used in a timeout. Generally I do a clientside timeout of .05 and then do it. so:
NPC Code: I can guarantee you that will work ;) Also, if you're using keydown2 it requires(key,true/false) I believe. So if keydown2(8,true) then it will perform the function. It AGAIN is NOT an action but a function as Kai calls them. To me, everything in an if statement is an action or a non-action. If you can use it like if (playerchats) || if (playertouchsme) kind of stuff, then it's an action. if (strequals(#a,Projectshifter)) however is not. That does not run by itself. hope it helps, enjoy. ---Shifter |
Personally, I would use a timeout of .1 when using keydowns because .05 is too sensitive.
-Ningnong |
Quote:
No reason to use 0.1 clientside. |
I hate .05's because you have to just "touch" the key, and you find your self getting your tap right before it works (like its on and of with one normal press)..
|
Clientside I am most times using timeouts of 0.05 seconds.
The script should react immediatly and not lag behind a bit. If you don't want the action to be repeated too often there are two ways. The first way is to make sure that the key has been released before it has been repressed. The second way is to count the time that has passed since the last action was triggered by the key. |
I dont use keydown so much...
keydown2 is better. |
Quote:
|
thanx to all of you, you helped out alot
|
.05 may have it repeat at times, but then again when you do a GUI or something, .1 may be not sensitive enough, people often just tap and release. I'd say set a variable.
NPC Code: That may be the best way. ---Shifter |
Quote:
|
Ok, now the same thing has been said by me, Shifter and CheeToS2. Is there anybody else who wants to repeat it? ;)
|
nah, I'd say 3 times is a charm....
|
meh, I'd rather do
NPC Code: but if it needs to be in a timeout, then do what has been said three or four times now... |
Quote:
NPC Code: that would get rid of the "touch" and make it for everytime that you press it... or somthing like that =o |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 06:50 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.