Jump to content

Question

Posted (edited)

Hello, I have problem again :P

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 by Mechomorph XD

3 answers to this question

Recommended Posts

Posted

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'.

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...