View Single Post
  #2  
Old 08-08-2011, 09:03 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
You should use

PHP Code:
function onKeyPressed(temp.code, temp.key, temp.scan) {
  if (
keydown(1)) {
    
player.chat = "Left!";
  } else if (
keydown(3)) {
    
player.chat = "Right!";
  }
} 
It's possible to check the key's code instead, but using keydown allows you to use the player's defined arrow keys.

There's a list of key numbers for keydown here.
__________________
Reply With Quote