Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   Ok. I can't stand this... (https://forums.graalonline.com/forums/showthread.php?t=6035)

BocoC 06-29-2001 01:44 AM

Ok. I can't stand this...
 
Help me. Ever since Graal 2.04, I have been having trouble with npcserver. I can't even get a frickin keydown event to work!

NPC Code:

if (playertouchsme) {
setstring this.owner,#a;
message Touched;
timeout=0.1;
}
if (timeout) {
with (getplayer(#s(this.owner))) {
if (keydown(6)) {
this.continue=true;
message Works;
}
}
sleep 2;
if (this.continue==true) {
message Yay!;
} else { timeout=0.1; }
}



I can touch it, because Touched works, but it won't work when the key A is pressed! ARG! Anyone care to help?

KJS 06-29-2001 01:49 AM

well keydown only works in a timer I think

KJS 06-29-2001 01:53 AM

oh yea it is
 
lol it is in a timer I didn't look at it all hehe..

well I beleve it has to be clientside also though...

because like in my gravity script I have it in the npc server but clientside...

BocoC 06-29-2001 02:53 AM

But the 'with' command makes it so the script works with the player... Hmm. I don't like how that was put...
NPC Code:

with (getplayer(#s(this.owner))) {
if (keydown(6)) {


To my knowledge, the 'with' command is making the enclosed script work for that player...

T-Squad 06-30-2001 12:11 AM

No....keydown doesn't work server side. Thats a problem with this...I made a balloon pumping event, but online it didn't work because of a few things:

1) Since keydown can only be reconized clientside, I had to set variables client side that were effected by keydown...

2) Since clientside variables can't be read serverside (according to...I forgot who...) it would be impossible for that script to work the way I want it to...

So instead, make a weapon, and make it use triggeraction....you could do basicly the same thing

Er1c 06-30-2001 12:18 AM

Quote:

Originally posted by T-Squad
2) Since clientside variables can't be read serverside (according to...I forgot who...) it would be impossible for that script to work the way I want it to...
It wouldn't be imposible, you could just use level.vars...

T-Squad 06-30-2001 12:21 AM

Quote:

Originally posted by Er1c


It wouldn't be imposible, you could just use level.vars...

Level.vars are able to be read if set clientside, then serverside reads them?

BocoC 06-30-2001 12:21 AM

=P Thanks for your help. I finally got the keydown event to work. You were right, it DOES have to be clientside. Now, the only thing that is stoping my script from working (I think) is the @#$%#$ replacegani commands. x_x Thanks for your help!

06-30-2001 03:48 AM

replaceani

not replacegani

grim_squeaker_x 06-30-2001 03:20 PM

Or you could just put the keydown thing in a system NPC which does a triggeraction when the keydown is done.

BocoC 06-30-2001 11:37 PM

Thanks for your help. I fixed my problems and everything is working correctly. =P Thanks again.


All times are GMT +2. The time now is 08:37 PM.

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