Jump to content
  • 0

custom NPC non clickable


namerpus18

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.07
  • Content Count:  95
  • Reputation:   1
  • Joined:  11/15/22
  • Last Seen:  

Hello everyone,

I want to make a simple chest npc that is not clickable and can only be triggered if a player come 1 cell near to it. I tried add "-" to the npcID# but it will make the npc invicible. 

 

Thank you,

prontera,147,173,4    script    Bulletin Board#29    1903,0,0,{
    mes "Opening chest in";
    sleep2 1000;
    mes "5...";
    sleep2 1000;
    mes "4...";
    sleep2 1000;
    mes "3...";
    sleep2 1000;
    mes "2...";
    sleep2 1000;
    mes "1...";
    sleep2 1000;
    mes "Loot obtained.";
    close;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/26/22
  • Last Seen:  

here it worked normally, try to check the npc tabs

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

prontera,147,173,4    script    Bulletin Board#29    1903,1,1,{
	end;

OnTouch:
    mes "Opening chest in";
    sleep2 1000;
    mes "5...";
    sleep2 1000;
    mes "4...";
    sleep2 1000;
    mes "3...";
    sleep2 1000;
    mes "2...";
    sleep2 1000;
    mes "1...";
    sleep2 1000;
    mes "Loot obtained.";
    close;
}
OnTouch:

This label will be executed if a trigger area is defined for the NPC object it's
in. If it isn't present, the execution will start from the beginning of the NPC
code. The RID of the triggering character object will be attached.
OnTouch_:

Similar to OnTouch, but will only run one instance. Another character is
chosen once the triggering character leaves the area.

 

or check the distance between NPC and Player

prontera,147,173,4    script    Bulletin Board#29    1903,{
	getmapxy(.@npc_map$, .@npc_x, .@npc_y, BL_NPC);
	getmapxy(.@map$, .@x, .@y, BL_PC);
	if (distance(.@npc_x, .@npc_y, .@x, .@y) > 1) end;
	mes "Opening chest in";
	sleep2 1000;
	mes "5...";
	sleep2 1000;
	mes "4...";
	sleep2 1000;
	mes "3...";
	sleep2 1000;
	mes "2...";
	sleep2 1000;
	mes "1...";
	sleep2 1000;
	mes "Loot obtained.";
	close;
}

 

Edited by Emistry
Link to comment
Share on other sites

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.

×
×
  • Create New...