Thread: keydown2
View Single Post
  #9  
Old 02-15-2008, 12:30 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
Quote:
Originally Posted by Chompy View Post
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(codekey) {
  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 )
__________________
Reply With Quote