
12-16-2001, 12:42 AM
|
|
Registered User
|
Join Date: Nov 2001
Location: VA, USA
Posts: 501
|
|
hmm
|
if possible, you want to stay away from sleep variables, because that stops everything in the NPC until the sleep is over. Try using something like this.sleep like this:
if (playerenters) {timeout = .1; show;
this.sleep=20;
this.on=1;
}
if (timeout) {
if (this.sleep>0) {this.sleep-=1;
}
if (this.sleep<=0) {this.sleep=20;
if (this.on=1) {this.on=0; hide;
}
if (this.on=0) {this.on=1; show;
}
}
timeout = .1;
}
That will make it so other flags can be unset/set while the sleep counter is going. If all you want to do in the npc is hide and show for some reason, use one of the previous scripts, other wise, if you have a lot of sleeping required, use this.vars so things are timed correctly.
also, since timeout is equal to 1/10th of a second, this.sleep=20 would wait 2 seconds, and then change. if the timeout was equal to .05 you might want to use 40 for this.sleep.
That about wraps it up. |
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager
"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
|
|
|
|