Jump to content
  • 0

Countitem help


Tassadar

Question


  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

Good morning everyone.

How do I show npc how many "X" items the player is loading?

Example:

mes "This npc works with Revenge Coins!"
mes "you have: (25) Coins of revenge!"

I found the countitem command, but I did not understand the operation.

Thank you very much in advance.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

To use that kind of command, you must understand that, countitem is a function, it means it gets a value and converts it based on it's parameters.

The player who interacts with the NPC is the one countitem will count items from, so, if you want your npc to display how many red potions he has:

mes "You have: " + countitem(501) + " Red Potions!";

Where 501 is the Red Potion ID.

 

Edited by Haziel
  • Upvote 1
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...