Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Need help with hitplayer.. (https://forums.graalonline.com/forums/showthread.php?t=45181)

Nitkizi 05-31-2003 09:08 PM

Need help with hitplayer..
 
Okay, does anyone have any idea or reason why hitplayer doesn't work properly? It only allows you to hit other players when they have it equipped also, but not when they don't have it equipped.

Quote:

//#CLIENTSIDE
if (weaponfired) {
if (this.use = 0) {
equip();
this.use = 1;
} else {
unequip();
this.use = 0;
}
}

if (strequals(spear_sl_stab,#m)) {
if (keydown(5)) {
for (this.p = 1; this.p < playerscount; this.p++) {
this.dx = playerx - players[this.p].x;
this.dy = playery - players[this.p].y;
this.dist = (this.dx^2 + this.dy^2)^0.5;
if (this.dist <= 3.5) hitplayer this.p,1,playerx,playery;
}
}
}

}

function equip() {
replaceani idle,spear_sl_idle;
replaceani walk,spear_sl_walk;
replaceani sword,spear_sl_stab;
}

function unequip() {
replaceani idle,idle;
replaceani walk,walk;
replaceani sword,sword;
}

Knuckles 06-01-2003 05:15 AM

Use hitobject... =o

Dach 06-01-2003 06:06 AM

put the strequals inside the keydown, nesting events inside of flags screws stuff up like that

Nitkizi 06-01-2003 09:56 AM

Too late, already fixed with triggeraction :megaeek:


All times are GMT +2. The time now is 07:12 PM.

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