Jump to content
  • 0

Help with "Ghost" NPC


Bert

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  02/03/12
  • Last Seen:  

I'm in need of help coding a "Ghost" NPC which disappears on "Next" and reappears several minutes after the player presses "Close"

	mes "Huh?";
	next;
disablenpc "Ghost";
	mes "I thought I saw someone standing there?";
	mes "My my mistake, maybe.";
enablenpc "Ghost"
close;

Secondly, how do I make a message box pop out when a player enters a specific portal? It's like Player A enters Room A's portal. Upon entering, a message box appears "This place stinks, let's get out", and upon clicking on "Close", the player is warped back to a set point.

Thanks in advance, seniors!

Edited by Bert
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  161
  • Reputation:   31
  • Joined:  12/06/11
  • Last Seen:  

location,X,Y,D	script	warp_name	45,2,2,{
OnTouch:
mes "["+strcharinfo(0)+"]";
mes "This place stinks, lets get out!";
close2;
warp map,x,y;
}

That should do it :P. As for the first issue, I don't quite understand what you mean.

Edited by garet999
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

use these script commands:

hideonnpc; // this will enable hiding skill on npc
hideoffnpc; // this will disable hiding skill on npc
sleep2 10000; // 10000 ms is equal 10 seconds.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  161
  • Reputation:   31
  • Joined:  12/06/11
  • Last Seen:  

You can interact with a hidden NPC, can't you? So its better to disable the NPC.

Edited by garet999
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

disablenpc will stop the script and you can't talk to hidden npc. Btw what he is trying to do is hide the NPC in middle of conversation.

Edited by darristan
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  02/03/12
  • Last Seen:  

location,X,Y,D	script	warp_name	45,2,2,{
OnTouch:
mes "["+strcharinfo(0)+"]";
mes "This place stinks, lets get out!";
close2;
warp map,x,y;
}

That should do it :P. As for the first issue, I don't quite understand what you mean.

The message box appears when I touch it, but I'm not warped. Plus, is it possible if the "npc" is invisible?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  161
  • Reputation:   31
  • Joined:  12/06/11
  • Last Seen:  

Oh sorry my bad, there's suppored to be an End after warp :P.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  02/03/12
  • Last Seen:  

Inserted end; , still unable to work D:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

warp "<mapname>",x,y;

It is possible by using hideonnpc; with OnInit:

Edited by darristan
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...