Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Sliden Script (https://forums.graalonline.com/forums/showthread.php?t=8860)

Poogle 08-04-2001 09:58 AM

Sliden Script
 
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)

NPC Code:

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

Quote:

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

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..


All times are GMT +2. The time now is 05:18 AM.

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