Poogle

08-04-2001, 09:58 AM

Anyone know the sliding script mthat makes the NPC slide away from the player when he/her is near it?

View Full Version : Sliden Script

Poogle

08-04-2001, 09:58 AM

Anyone know the sliding script mthat makes the NPC slide away from the player when he/her is near it?

LiquidIce00

08-04-2001, 10:13 AM

slide as in?

move away would be something like

(not tested)

timeout=.1;

if (timeout) {

//x check

for (this.i=0;this.i<playerscount;this.i++) {

if (abs(players[this.i].x-x)<2) {

if (players[this.i].x>x) { x--; }

if (players[this.i].x<x) { x++; }

}

}

//y check

for (this.i=0;this.i<playerscount;this.i++) {

if (abs(players[this.i].y-y)<2) {

if (players[this.i].y>y) { y--; }

if (players[this.i].y<y) { y++; }

}

}

}

move away would be something like

(not tested)

timeout=.1;

if (timeout) {

//x check

for (this.i=0;this.i<playerscount;this.i++) {

if (abs(players[this.i].x-x)<2) {

if (players[this.i].x>x) { x--; }

if (players[this.i].x<x) { x++; }

}

}

//y check

for (this.i=0;this.i<playerscount;this.i++) {

if (abs(players[this.i].y-y)<2) {

if (players[this.i].y>y) { y--; }

if (players[this.i].y<y) { y++; }

}

}

}

Poogle

08-06-2001, 01:13 AM

thanks ^_^ my football works right now thanks to you!

zokemon

08-06-2001, 03:38 AM

err i dont do it like that but what ever

Poogle

08-07-2001, 11:21 AM

Originally posted by zokemon

err i dont do it like that but what ever No one does it his way inless they need his help

err i dont do it like that but what ever No one does it his way inless they need his help

LiquidIce00

08-07-2001, 12:39 PM

that one is buggy i just did it on the spot .. but it should work okay and its a beginning..

vBulletin® v3.8.11, Copyright ©2000-2019, vBulletin Solutions Inc.