I'm looking to trigger an action on another player for the combat system I am making.
How do I trigger the
hurt function in the other player. (Need help where the // is)
-system/hurt
PHP Code:
//#CLIENTSIDE
function onHurt(){
player.chat = "Hurt!";
}
-system/combat
PHP Code:
function onActionServerSide(){
if (params[0] == "attack"){
//trigger onHurt in the -system/hurt weapon of the player right in front of you
}
}
//#CLIENTSIDE
function onKeyPressed(code, key){
if (key == "s"){
player.chat = "Attack!";
triggerserver("weapon", this.name, "attack");
}
}
side note:
Is triggering a serverside function in an NPC similar to triggering another player?
I need to trigger the onHurt() with the baddies too.