Jump to content
  • 0

Adding a chatbox function over NPCs.


IndieD

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   1
  • Joined:  06/13/12
  • Last Seen:  

I'm trying to add a PvP warper that has the number of the people currently inside, to the people that can be in pvp.

How would I add the chat-box function over its head to give it a live feed of people inside?

Thank you!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

Try this :

NPC,Header,here,{
OnInit:
set .map$,"YOURMAPHERE";
waitingroom "["+getmapusers(.map$)+"/15]",0;
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   1
  • Joined:  06/13/12
  • Last Seen:  

Would I put the chat functions after the "end;" command?

Nevermind, figured it out.

However, it doesn't show the current amount of people inside.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

Hmm...That's because of the OnInit: I think. Maybe you could add a npctalk instead of the Waitingroom :

So if a Player clicks the NPC the NPC talks like a Player and says how many people are fighting in the PvP Room.

NPC HEADER ,{

set .map$,"YOURMAPNAME";

npctalk "There are ["+getmapusers(.map$)+"/15] in the PvP Room.";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   1
  • Joined:  12/21/11
  • Last Seen:  

Try this.it will show if theres a player inside.If you click you will be warp inside.refresh every seconds.

MAP,XXX,YYY,4 script PVP npc,{

warp "pvp map",X,Y;

end;

OnInit:

while(1)

{

DelWaitingRoom;

WaitingRoom("PvP: " + GetMapUsers("pvp map"), 0);

sleep 1000;

}

}

Edited by maynard
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   1
  • Joined:  06/13/12
  • Last Seen:  

Thanks!

Both of these worked.

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