Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   vecx / vecy trouble (https://forums.graalonline.com/forums/showthread.php?t=134263543)

xAndrewx 06-12-2011 10:56 PM

vecx / vecy trouble
 
Hiya

I'm seeking advise-

I'm making an NPC which will kill the player in front of it within a certain distance

However, when I use something like this

HTML Code:

for (temp.pl: players) {
  if (temp.pl.x in |this.x + 1.5, this.x + 1.5 + (vecx(this.dir) * temp.view)| &&
      temp.pl.y in |this.y + 1.5, this.y + 1.5, (vecy(this.dir) * temp.view)|) {
    temp.pl.ani = "dead";
  }
}

This works if the NPC is facing down and right, but facing up or left it won't work. Any ideas?

fowlplay4 06-12-2011 11:07 PM

this.y + 1.5, this.y + 1.5 , (vecy(this.dir) * temp.view)

The 2nd , should be a +.


All times are GMT +2. The time now is 03:53 PM.

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