Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   some help plz? (https://forums.graalonline.com/forums/showthread.php?t=32704)

faiola 07-02-2002 01:51 AM

some help plz?
 
argh again i ask for help

grrr..:grrr: :grrr: :grrr:

// NPC made by X.Draco.X

if (playertouchsme) {
hide;
abovehead();
showimg 304,i_mpbottle.gif,playerx,playery-1;
playermp+=25;
sleep 4;
show;
}

function abovehead() {
for (i=0;i<100;i++) {
showimg 304,i_mpbottle.gif,playerx,playery-1;
sleep .01;
}
}


why don't this one work?
i said many times b-4 that i am a bad scripter and i say it again....

all i want it to do is show it above the persons head for like 3 seconds then dissappear and regenerate .......

this is why i'm a lat not a nat....:grrr: :grrr: :grrr: :grrr:

Python523 07-02-2002 02:02 AM

first of all you CANNOT have a sleep or timeout under .05, graal CANNOT go faster than 20 fps (frames per second)
second - if you want to hide an image, use hideimg <index>
third - why are you using a for loop for this? look into timeout loops

faiola 07-02-2002 02:20 AM

well jeez somone's cranky
i know how to use timeout loops but i didn't know if that will work online under this case
and it works as timeout = .01;

Python523 07-02-2002 02:31 AM

.01 cant work as a timeout because graal doesnt run that fast why wont you believe me

IAMNOTAFREAK 07-02-2002 08:17 AM

Quote:

Originally posted by Python523
.01 cant work as a timeout because graal doesnt run that fast why wont you believe me
he's right, you know...

anyway, easiest way i do something like that is use showimg under a timeout, use a simple counter every timeout, then after the amount of time you want cancel the timeout and use hideimg...
something like

if (blah){
timeout=.05;
}
if (timeout){
this.show++;
if (this.show<60){showimg 1,blah,x,y;timeout=.05;}
if (this.show=>60){hideimg 1;}
}

something like that...

Torankusu 07-02-2002 08:31 AM

timeout=0.1;

draygin 07-02-2002 08:47 AM

Quote:

Originally posted by Python523
.01 cant work as a timeout because graal doesnt run that fast why wont you believe me
I've used time out .1 for doors and it worked fine for me online and offline. =\

Python523 07-02-2002 09:32 AM

Quote:

Originally posted by draygin


I've used time out .1 for doors and it worked fine for me online and offline. =\

0.1 and 0.01 is A LOT different

draygin 07-02-2002 10:33 AM

Quote:

Originally posted by Python523

0.1 and 0.01 is A LOT different

ahhh I missed that part. *ambles of whistling*


All times are GMT +2. The time now is 04:15 PM.

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