Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:24 PM.


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