Mechomorph XD Posted May 18, 2012 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 71 Reputation: 1 Joined: 03/06/12 Last Seen: January 22, 2021 Share Posted May 18, 2012 (edited) Hello, I have problem again I'm doing function which this function will call from item. 1234,ITEM,...... { callfunc "Hello"; } So that function have menu shop, It's will call shop before select menu already. And problem is I'm add OnBuyItem event in function but Map-Server noticed error. [Error]: npc_event: event not found [FAKE_NPC::OnBuyItem] How to do that? or Who have idea about call npc from item? Thank You. Oh, Forget this some part of my function mes "x"; callshop "x",1; npcshopattach "x"; close; I'll want the player buy item and before that goto on OnBuyItem event. Edited May 18, 2012 by Mechomorph XD Quote Link to comment Share on other sites More sharing options...
Omnipotent Posted May 19, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 71 Reputation: 25 Joined: 11/23/11 Last Seen: May 16, 2024 Share Posted May 19, 2012 It is already saying that, the function is like a FAKE NPC, try changing the function into a floating script and use doevent. Quote Link to comment Share on other sites More sharing options...
Mechomorph XD Posted May 19, 2012 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 71 Reputation: 1 Joined: 03/06/12 Last Seen: January 22, 2021 Author Share Posted May 19, 2012 I can do it. Thank You Quote Link to comment Share on other sites More sharing options...
Emistry Posted May 22, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: April 20 Share Posted May 22, 2012 instead of using the function calling method....you can use these *donpcevent "{NPC NAME}::<event label>"; This command invokes the event label code within an another NPC or NPCs. If event label has the form "NpcName::OnLabel", then only given NPC's event label will be invoked (much like 'goto' into another NPC). If the form is "::OnLabel" (NpcName omitted), the event code of all NPCs with given label will be invoked, one after another. In both cases the invoked script will run without an attached RID, whether or not the invoking script was attached to a player. The event label name is required to start with On. *doevent "<NPC object name>::<event label>"; This command will start a new execution thread in a specified NPC object at the specified label. The execution of the script running this command will not stop. No parameters may be passed with a doevent call. The script of the NPC object invoked in this manner will run as if it's been invoked by the RID that was active in the script that issued a 'doevent'. Quote Link to comment Share on other sites More sharing options...
Question
Mechomorph XD
Hello, I have problem again
I'm doing function which this function will call from item.
So that function have menu shop, It's will call shop before select menu already.
And problem is I'm add OnBuyItem event in function but Map-Server noticed error.
How to do that? or Who have idea about call npc from item?
Thank You.
Oh, Forget
this some part of my function
I'll want the player buy item and before that goto on OnBuyItem event.
Edited by Mechomorph XDLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.