View Single Post
  #1  
Old 08-19-2013, 06:54 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Triggering Functions on other Players

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(codekey){
 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.
Reply With Quote