Creation/Dev/Script/Functions/keydown: Difference between revisions
From Graal Bible
(Created page with 'Category:Scripting Reference ''Clientside'' ''Description'' <p>Used to check which key a player has held down.</p> example: <pre> function onKeyPressed() { if (keydown(5))…') |
(No difference)
|
Revision as of 17:48, 26 April 2010
Clientside
Description
Used to check which key a player has held down.
example:
function onKeyPressed()
{
if (keydown(5))
{
player.chat = "You pressed s";
}
}Checks if the player presses the default sword key.
Notes
Joysticks only work with keydown, not keydown2.
| Value | Description |
| 0 | up |
| 1 | left |
| 2 | down |
| 3 | right |
| 4 | a |
| 5 | s |
| 6 | d |
| 7 | m |
| 8 | TAB |
| 9 | q |
| 10 | p |