Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Drowning script (i need help) (https://forums.graalonline.com/forums/showthread.php?t=24787)

Andor_RC14 03-01-2002 04:32 AM

Drowning script (i need help)
 
were it says onwater is wrong what do i put thier to work it i tried
if (playerswimming) --nothing seems to work

// Made by Mystical Dragon
//#CLIENTSIDE
if (onwater( x, y )){
showimg 1000,@@c@Water Count 0/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,0,0,3,0;}
if (onwater( x, y )){
showimg 1000,@@c@Water Count 1.5/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 2/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 4/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 6/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 8/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 10/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 12/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 13/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 13.5/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 14/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 15/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,2,0,0,0;
sleep 2;
playerhearts=>0}

P.S

Script thiefs are lame

TDK_RC6 03-01-2002 04:38 AM

well, i noticed that in the onwater flags, there were spaces, i dont know if that is what is messing it up or not though

Lomgren 03-01-2002 04:47 AM

try playerx and playery, your just checking the x,y of the npc, unless it is in a weapon or something where its
position = playerspos...

nyghtGT 03-01-2002 04:59 AM

Re: Drowning script (i need help)
 
Quote:

Originally posted by Andor_RC14
were it says onwater is wrong what do i put thier to work it i tried
if (playerswimming) --nothing seems to work

// Made by Mystical Dragon
//#CLIENTSIDE
if (onwater( x, y )){
showimg 1000,@@c@Water Count 0/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,0,0,3,0;}
if (onwater( x, y )){
showimg 1000,@@c@Water Count 1.5/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 2/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 4/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 6/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 8/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 10/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 12/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 13/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 13.5/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 14/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 15/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,2,0,0,0;
sleep 2;
playerhearts=>0}

P.S

Script thiefs are lame

i dont know who would want to steal that script, lol ....
try this:
NPC Code:

NPC Code:

if (onwater(vecx,vecy)) {
for (i=15;i>0;i--) {
sleep 2;
showimg 1000,@@c@Water Count i/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
if (i=15) {
changeimgcolors 1000,2,0,0,0;
}
if (i<=14&&i>=1) {
changeimgcolors 1000,1,1,0,1;
}
if (i=0) {
changeimgcolors 1000,0,0,3,0;
}
}
}





edit:
I added 'vecx,vecy' I am totally unsure about using that ...

nyghtGT 03-01-2002 05:05 AM

Quote:

Originally posted by TDK_RC6
well, i noticed that in the onwater flags, there were spaces, i dont know if that is what is messing it up or not though
was that a charity script ?
:D

Saga2001 03-01-2002 06:24 AM

ummmmm use a for loop or while....please?

Faheria_GP2 03-01-2002 08:44 AM

Quote:

(i need help)
you need more "help" than anyone here can give you

I am referring you to a psychiatrist right now

nyghtGT 03-01-2002 09:04 AM

Quote:

Originally posted by Faheria_GP2


you need more "help" than anyone here can give you

I am referring you to a psychiatrist right now

hey i sorta knew him, he is nice, just sucks at scripting ...

Lomgren 03-01-2002 09:10 AM

NyghtGT, just so you know, vecx and vecy are basically hardcoded arrays that are used for the x,y movement for directions,

x += vecx(dir);
y += vecy(dir);

you would use something like that for moving the npc according to it's direction.

nyghtGT 03-01-2002 02:21 PM

Quote:

Originally posted by Lomgren
NyghtGT, just so you know, vecx and vecy are basically hardcoded arrays that are used for the x,y movement for directions,

x += vecx(dir);
y += vecy(dir);

you would use something like that for moving the npc according to it's direction.

uhh, ok ...
i said i wasn't sure and thanx for correcting me ...

Andor_RC14 03-01-2002 08:19 PM

Nyght GT
 
You no me can you speack english please i dont no what vex is ROLF
what would thscript be if i added that

Andor_RC14 03-01-2002 08:26 PM

this still wont work wtf
 
//#CLIENTSIDE
if (!onwater(playerx+1.5+vecx(playerdir)*2,playery+2+ vecy(playerdir)*2)) {
showimg 1000,@@c@Water Count 0/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,0,0,3,0;}
if (onwater(playerx+1.5+vecx(playerdir)*2,playery+2+v ecy(playerdir)*2)) {
showimg 1000,@@c@Water Count 1.5/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 2/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 4/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 6/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 8/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 10/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 12/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 13/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 13.5/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 14/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,1,1,0,1;
sleep 1.5;
showimg 1000,@@c@Water Count 15/15,screenwidth-75,screenheight-25;
changeimgvis 1000,5;
changeimgcolors 1000,2,0,0,0;
sleep 2;
playerhearts=>0}

Loriel 03-01-2002 08:45 PM

You need to put the checking thing in a permanent timeout loop.

Try this, not sure.
NPC Code:

//#CLIENTSIDE
if (playerenters || timeout) {
if (onwater(playerx+1.5,playery+2)) this.wcount += 0.05;
else this.wcount = 0;
showimg 1000,@@c@Water Count #v(this.wcount)/15,screenwidth-75,screenheight-25;
if (this.wcount>15) playerhearts = 0;
timeout = 0.05;
}


Andor_RC14 03-01-2002 08:49 PM

Loriel
 
i tryed that it says
Error: No if-clause specified

Saga2001 03-01-2002 10:23 PM

NPC Code:

//#CLIENTSIDE
if (playerenters || timeout) {
if (onwater(playerx+1.5,playery+2)) {this.wcount += 0.05;}
else {this.wcount = 0;}
showimg 1000,@@c@Water Count #v(this.wcount)/15,screenwidth-75,screenheight-25;
if (this.wcount>15) {playerhearts = 0;}
timeout = 0.05;
}



I ono...lol...what no if clause specified means is that you have an else somewhere, but no original if. To fix that make sure if you don't have curly brackets ({}) around an if phrase than make sure that there is only one command, if you have this:
NPC Code:

// this works:
if (playerenters) message hi;
else message;
//this doesn't, it will give you a no if clause specified error:
if (playerenters) message hi;
setplayerprop #c,hi;
else message;
setplayerprop #c,;



Understand?

Andor_RC14 03-02-2002 03:29 AM

Saga
 
no i dont understand

Andor_RC14 03-02-2002 03:30 AM

WTF
 
i tried every thing you just hate me
look i kept on adding what peeps tolled me to i did the hole danm script myself

joseyisleet 03-02-2002 03:52 AM

-=Josey=-
Cry elsewhere, Kaimetsu is the moderator therefore he has "uber leet powerz" to do what he wants with a thread. I'd close this thread myself anyway. You didn't follow any of the guidelines. You missed the code tags and also you shouldn't have posted the whole script just the part that you thought was messed up.


All times are GMT +2. The time now is 11:47 PM.

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