Quote:
Originally Posted by i8bit
I took what was read above into consideration. Thank you. But I am running all pvp actions via Clientside.
With that said, I am having issues and can't find out why this won't work.
This is the script for the weapon "Combat"
PHP Code:
//#CLIENTSIDE function onKeyPressed(code, key){ if (key == "s"){ setAni("sword", NULL)' if (player.x in |this.x-2, this.x + 1| && player.y in |this.y-1, this.y + 3|) { triggerAction(player.x, player.y, "SYSTEM/damage", "Hurt"); } } }
And this is the weapon for my damage system:
PHP Code:
//#CLIENTSIDE function onHurt(){ setAni("hurt", NULL); player.chat = "HURT!"; }
It's not triggering the function.
I know the x1,x2 and y1,y2 and a little outa wack. I'm just testing with the player.dir == 3
|
The problem is largely going to be in your condition. Not to mention the snippet you gave us does not have a ; after setani().
Think about this.x and this.y also: this. Refers to the weapon as the object. Probably not something you are going to want to do in this instance..
And player.x and player.x refers specifically the top left of the player.
The way this is set up it almost seems as if you want to hurt yourself, which might be fine for testing, but you can put the same onHurt function in a class and join it to an npc that looks like a player character as well to test animations.
While you're still early in the script i'd read up on vecx and vecy because it will come in handy for determining a position in front of a player.
Here is a thread explaining it:
http://forums.graalonline.com/forums...47#post1649547
Also, here is an old example using a mining system that might help you set up better testing procedures (the triggers and receiving of them can be applied to a combat system)
http://forums.graalonline.com/forums...ad.php?t=68273