Jump to content

Question

Posted (edited)

Hello,

I'm trying to use callfunc but if the function is written on an other npc it doesn't work.
I read this on wiki
 

*callfunc "<function>"{,<argument>,...<argument>};
  *callfunc("<function>"{,<argument>,...<argument>})
   
  This command lets you call up a function NPC. A function NPC can be called from
  any script on any map server. Using the 'return' command it will come back to
  the place that called it.

 

Alternately, as of rAthena revision 15979 and 15981, user-defined functions
  may be called directly without the use of the 'callfunc' script command.

 

Calling a function written inside a npc works but when i'm trying to call a function from an other npc it says : buildin_callfunc Function Not found.
Example that works :

 

gonryun,147,127,6    script    testfunction    808,{
function helpme;
function helpme{
    mapannounce "gonryun", "Rathena, please help me.", bc_map;
    end;
}

    helpme;

    mes "you send message to Rathena";
    end;
}

I am trying to do this on the NPCnumber2 :

gonryun,147,127,6    script    testfunction    808,{
function helpme;
function helpme{
    mapannounce "gonryun", "Rathena, please help me.", bc_map;
    end;
}

    helpme;

    mes "you send message to Rathena";
    end;


}


gonryun,141,127,6    script    NPCnumber2    809,{
    callfunc "helpme";

   end;

}

thank you

Edited by kilow

2 answers to this question

Recommended Posts

  • 0
Posted
function	script	my_global_func	{
	mes "this message from 'my_global_func' function from out the npc";
	return;
}

prontera,0,0,0	script	func_test	444,{
	function my_func;
	
	my_func();
	next;
	my_global_func();
	next;
	callfunc("my_other_global_func");
end;

	function	my_func	{
		mes "this message from 'my_func' function from inside the npc";
		return;
	}
}

function	script	my_other_global_func	{
	mes "this message from 'my_other_global_func' function from out the npc";
	return;
}

 

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...