Jump to content
  • 0
Sign in to follow this  
Domo

I need a mes for another player/character

Question

it's me again  :swt3:

 

What do you guys put in a script so that mes opens for another character?

 

Example:

 

Player1 whispers Player2's name to an NPC > The NPC now invokes mes onto Player2 but not Player1.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

You need to use the attachrid script command. Look it up on the wiki : http://herc.ws/wiki/Attachrid

 

Following the wiki's example :

 

mes "[NPC]";mes "Enter a name of a player.";next;input .@playername$;mes "[NPC]";mes "Enter a message.";next;input .@message$;set .@playerid,getcharid(3,.@playername$);  // retrieve rid of another playerset .@invokeid,getcharid(3);                // retrieve rid of the current playerdetachrid;                                  // detaches the current player,                                            // although not necessary before attachridif(.@playerid && attachrid(.@playerid))     // playerid is 0 if player is offline{    dispbottom .@message$";                 // Displays the message to second player}else{    set .@playerid,0;                       // indicate attachrid failure}if(attachrid(.@invokeid))                   // attach back to the first player{    if(.@playerid)    {        mes "I have said " + .@message$ + " to "+.@playername$+".";    }    else    {        mes "I was not able to reach "+.@playername$+".";    }    close;}end;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.