View Single Post
  #2  
Old 05-29-2012, 04:13 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
The event is only called once per keypress. The variable is not going to change values midway through the function. You'd have to keep track of which keys are being pressed:

PHP Code:
function GraalControl.onKeyDown(temp.codetemp.key) {
  if (! 
this.key.(@ temp.key)) {
    
this.key.(@ temp.key) = true;
    
    if (
temp.key in {"b""v""c"} && this.key.&& this.key.&& this.key.c) {
      
player.chat "combo attack!!";
    }
  }
}

function 
GraalControl.onKeyUp(temp.codetemp.key) {
  
this.key.(@ temp.key) = false;

Also, for comparison, you need to use == instead of =. One equals sign is used only for assignment.
__________________
Reply With Quote