Something like this should work:
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.cheatcode = {"A","A","D","S","A","D","D"};
this.keycache = new[0];
}
function onKeyPressed(code,key) {
this.keycache.add(key);
if (@this.keycache == @this.cheatcode) {
player.chat = "Cheat Activated!";
onTimeout();
} else setTimer(1);
}
function onTimeout() {
this.keycache = new[0];
}
I
think the timer in an NPC is a single variable, so in theory this would work. Whenever you hit a key it resets the timer, and you have one second to push the next key before it clears the cache.