Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Whats wrong... (https://forums.graalonline.com/forums/showthread.php?t=8441)

Aknts 07-30-2001 11:24 AM

Whats wrong...
 
Whats wrong with this script the stars dont move?


if (created) {
this.stars=20;
this.s=1;
this.sfdef={26,56,20,2};
this.speed={1,1};
//
setarray this.star, this.stars*3;
for (this.s=0;this.s<this.stars;this.s++) {
this.star[this.s*3]=random(this.sfdef[0]*10,(this.sfdef[0]+
this.sfdef[2])*10)/10;
this.star[this.s*3+1]=random(this.sfdef[1]*10,(this.sfdef[1
]+this.sfdef[3])*10)/10;
this.star[this.s*3+2]=random(this.speed[0],this.speed[1])/1
0;
}
timeout = .05;
}
if (timeout) {
for (this.s=0;this.s<this.stars;this.s++) {
if (this.star[this.s*3+1]>this.sfdef[1]+this.sfdef[3]) {
this.star[this.s*3]=random(this.sfdef[0]*10,(this.sfdef[0
]+this.sfdef[2])*10)/10;
this.star[this.s*3+1]=random(this.sfdef[1]*10,(this.sfdef
[1]+this.sfdef[3])*10)/10;
this.star[this.s*3+2]=random(this.speed[0],this.speed[1])
/10;
}
else this.star[this.s*3+1]+=this.star[this.s*3+2];
showimg this.s,kstar.gif,this.star[this.s*3],this.star[this.s*3+1];
}
timeout = .1;
}

KJS 07-30-2001 12:01 PM

what....
 
what is this not doing???
i dont feel like putting it into a npc..
and are you putting it in a npc server or not???

Aknts 07-30-2001 01:50 PM

*bump*

Falcor 07-31-2001 12:11 AM

NPC Code:

if (created) {
this.stars=20;
this.s=1;
this.sfdef={26,56,20,2};
this.speed={1,1};
setarray this.star,this.stars*3;
for (this.s=0;this.s<this.stars;this.s++;) {
this.star[this.s*3]=random(this.sfdef[0]*10,(this.sfdef[0]+this.sfdef[2])*10)/10;
this.star[this.s*3+1]=random(this.sfdef[1]*10,(this.sfdef[1]+this.sfdef[3])*10)/10;
this.star[this.s*3+2]=random(this.speed[0],this.speed[1])/10;
}
timeout = 0.1;
}
if (timeout) {
for (this.s=0;this.s<this.stars;this.s++;) {
if (this.star[this.s*3+1]>this.sfdef[1]+this.sfdef[3]) {
this.star[this.s*3]=random(this.sfdef[0]*10,(this.sfdef[0]+this.sfdef[2])*10)/10;
this.star[this.s*3+1]=random(this.sfdef[1]*10,(this.sfdef[1]+this.sfdef[3])*10)/10;
this.star[this.s*3+2]=random(this.speed[0],this.speed[1])/10;
}else {
this.star[this.s*3+1]+=this.star[this.s*3+2];
}
showimg this.s,kstar.gif,this.star[this.s*3],this.star[this.s*3+1];
}
timeout = 0.1;
}





There. You forgot the ; at the end of your for loops. hehehe

zokemon 07-31-2001 12:53 AM

LOL!!!!!!!

Merlin 07-31-2001 01:09 AM

Quote:

Originally posted by zokemon
LOL!!!!!!!
stop spamming and jump off the earth.

Brady2 07-31-2001 07:36 AM

Jadis:

You shouldn't need ;'s at the end of the for loop

for (hi=0;hi<1;hi++) setplayerprop #c,hi;

ZORG1986 07-31-2001 10:28 AM

Damn none of these messages are really helping solve the problem, i bet no one reading this has turned the code into an NPC yet, cause i know i haven't :P

General 07-31-2001 11:29 AM

The skull kreeps me out


All times are GMT +2. The time now is 10:49 PM.

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