Jump to content
  • 0

Item Scanner


zmref

Question


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

I am requesting for a script that does this following:

Example:

-If tcg is available in the character's inventory

do this

mes "Hi";

-else

do this

mes "you don't have this particular item, TCG";

In short, I want to know the code that scans for a certain item in the player's inventory.

What is it?

Thanks in advance. :D

I'm looking for a script that scans the item's availability in the player's inventory.

More Info:

If (TCG is in the player's inventory){

set .@value = 50;

}

else if (Apple is in the player's inventory){

set .@value = 40;

}

else (TCG is not in the player's inventory){

close;

}

In short I just want to know the code inside a condition statement whereas it scans for the item's availability.

Thanks in advance!. :D

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


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

if( countitem( itemID ) ){
set .@Value,X;
}

replace the itemID and X

*countitem(<item id>)
*countitem("<item name>")

This function will return the number of items for the specified item ID that the
invoking character has in the inventory.
mes "[item Checker]";
mes "Hmmm, it seems you have "+countitem(502)+" apples";
close;
Like 'getitem', this function will also accept an 'english name' from the
database as an argument.
If you want to state the number at the end of a sentence, you can do it by
adding up strings:
mes "[item Checker]";
mes "Hmmm, the total number of apples you are holding is "+countitem("APPLE");
close;

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

thanks emistry!, that was what I'm looking for

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