Jump to content
  • 0

Question

Posted

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

2 answers to this question

Recommended Posts

Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...