Quote:
Originally Posted by Chompy
well, you kind of can:
PHP Code:
//#CLIENTSIDE
function onCreated()
setTimer(0.1);
function onTimeout() {
// or whatever to detect if it's not held down
if (!keydown(5)) this.canhit = true;
setTimer(0.1);
}
function onKeyPressed(code, key) {
switch (lowercase(key)) {
case "s":
if (this.canhit) {
player.chat = "s";
this.canhit = false;
}
break;
}
}
|
That would never work. x.x
If we're having a timeout anyway, why not just use keydown2?
Also should use key.lower() instead of lowercase( key )