
07-31-2001, 02:57 PM
|
|
Banned
|
 |
Join Date: Mar 2001
Location: In a Trash Can
Posts: 3,708
|
|
NPC Baddies...
|
Hiyas!
Before I say anything, I'll just say, I SUCK AT SCRIPTING!!!!
ok..
Now I was trying to make a baddie that would move around randomly, and between directional switces, it would pause 1 second, then it would pick a random direction, or it would just stay still for another second again.
All I get out of this script is a bunch of MESSED UP LOOKIN' movement that makes my baddie look like it took some crack cocaine right after running around firepole for at LEAST 7 years straight. I also would like if someone could tell me how to make it so that when the baddie wasn't walking, it would change to idle.gani.
If you are thinking of just re-creating the script(because my work SUCKS), please make it long and drawn out so that us newbie scripters can understand what the script is doing. - thanks
---
//Script made by Jerom
//Isawk@scriptin'
if (created && playerenters) {
dontblock;
drawoverplayer;
timeout = 0.05;
this.speed = 0.09;
setarray move,4;
}
if (timeout && this.stop==0){
this.mmode = random(0,50);
timeout = 0.05;
}
if (this.mmode<=10 && timeout){
move[3] = 1;
this.stop = 1;}
if (move[3]==1 && timeout){
x+=this.speed;
move[4] = random(0,50);
this.stop = 1;}
if (this.mmode>10 && this.mmode<20 && timeout) {
move[2] = 1;}
if (move[2]==1 && timeout){
y+=this.speed;
move[4] = random(0,50);
this.stop = 1;}
if (this.mmode>20 && this.mmode<30 && timeout){
move[1] = 1;}
if (move[1]==1 && timeout){
x-=this.speed;
move[4] = random(0,50);
this.stop = 1;}
if (this.mmode>30 && this.mmode<=40 && timeout) {
move[0] = 1;
}
if (move[0]==1 && timeout){
y-=this.speed;
move[4] = random(0,50);}
if (move[4]<=10) {
move[0] = 0;
move[1] = 0;
move[2] = 0;
move[3] = 0;
this.stop = 0;
this.mmode = random(0,50);}
if (this.mmode>40 && this.mmode<50) {
sleep 1;
timeout = 0.05;}
|
|
|
|