| cbk1994 |
03-27-2011 02:22 AM |
Please indent your code if you're going to release it, and use PHP tags instead of QUOTE tags.
PHP Code:
//Scripted by McChucken //#CLIENTSIDE function onKeyPressed(num1, code, num2) { if (code == "1") { player.chat = "update level"; } sleep 0.1; player.chat = ""; }
In addition, there are several errors with it. Since the sleep and the line that resets the player's chat aren't in the if block, they'll happen any time you press a key.
I've corrected the code and left comments:
PHP Code:
//Scripted by McChucken //#CLIENTSIDE function onKeyPressed(code, key, scancode) { // code is the first parameter, not the second if (key == "1") { player.chat = "update level"; sleep(0.1); // use parentheses for parameters, you had GS1 before player.chat = ""; } }
Nice attempt, though. Trying is the best way to learn. Sorry if I come off as being an ass, I'm just trying to make sure you understand the mistakes so you'll become a better scripter.
|