Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Script Not Working (https://forums.graalonline.com/forums/showthread.php?t=60252)

raiden0899 07-30-2005 12:57 AM

Script Not Working
 
I made a small NPC just to see what the keycodes were (like 'a' is 65). It works with all the keys except the arrow keys. Here's the script:
NPC Code:

//#CLIENTSIDE
if (created) {
this.on=0;
}
if (weaponfired) {
if (this.on==0) {
this.on=1;
disabledefmovement;
}
else {
if (this.on==1) {
this.on=0;
enabledefmovement;
}
}
}
if (keypressed&&this.on==1) {
setplayerprop #c,Code=#p(0) Key=#p(1);
}


Anyone know why it won't work?

Bl0nkt 07-30-2005 01:13 AM

Change (weaponfired) to (keypressed && keydown2(keycode(d),true))

raiden0899 07-30-2005 01:22 AM

Quote:

Originally Posted by Bl0nkt
Change (weaponfired) to (keypressed && keydown2(keycode(d),true))

If I use that it's the same thing except I won't need the weapon equipped. Even if I did use that, it wouldn't make the arrow keys work.

Tolnaftate2004 07-30-2005 02:50 AM

Arrow keys do not call keypressed.

Bl0nkt 07-31-2005 12:31 AM

Quote:

Originally Posted by raiden0899
If I use that it's the same thing except I won't need the weapon equipped. Even if I did use that, it wouldn't make the arrow keys work.

Read that wrong. Sorry about that. I thought the problem was you couldn't get it to activate.

hotrian 08-01-2005 12:08 PM

Really, No one knows the answer..?
Keys match Player direction O.o
U = 0
L = 1
D = 2
R = 3
Or atleast last I checked they did

Skyld 08-01-2005 03:04 PM

Quote:

Originally Posted by hotrian
Really, No one knows the answer..?
Keys match Player direction O.o
U = 0
L = 1
D = 2
R = 3
Or atleast last I checked they did

That is when you use keydown()

hotrian 08-01-2005 03:56 PM

Doesnt it work both ways?
Why would u need to use keydown2
Sence arrow keys cant be capitolized anyway...
The whole point of the script is to see the codes isnt it?

CheeToS2 08-01-2005 05:05 PM

Quote:

Originally Posted by Tolnaftate2004
Arrow keys do not call keypressed.

They do on Graal 4 :)


All times are GMT +2. The time now is 02:46 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.