Quote:
Originally Posted by cbkbud
Because you can't use that to detect when a key is held down.
|
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;
}
}