A while ago i posted a thread on How to set an "if" statement for a onPlayerTouchsMe and check the player gani to see if he is attacking.
Thread:
http://forums.graalonline.com/forums...t=blackbeltben
Thor told me i Should not do my collision like that so i changed it with the script he gave me but it doesnt seem to be working. I put it in a weapon added to the player.
I'm expecting it to trigger the action of "onWasDmg" of the baddie
PHP Code:
function onAttack()
{
temp.x = player.x + 0.5 + (vecx(player.dir) * 2);
temp.y = player.y + 1 + (vecy(player.dir) * 2);
temp.tnpcs = findareanpcs(temp.x, temp.y, 2, 2);
for(temp.n : temp.tnpcs){
temp.n.trigger("onWasDmg", player.clientr.power);
}