zmref Posted July 10, 2012 Group: Members Topic Count: 148 Topics Per Day: 0.03 Content Count: 299 Reputation: 6 Joined: 06/14/12 Last Seen: March 30, 2013 Share Posted July 10, 2012 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. 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!. Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 10, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: 9 hours ago Share Posted July 10, 2012 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; 1 Quote Link to comment Share on other sites More sharing options...
zmref Posted July 10, 2012 Group: Members Topic Count: 148 Topics Per Day: 0.03 Content Count: 299 Reputation: 6 Joined: 06/14/12 Last Seen: March 30, 2013 Author Share Posted July 10, 2012 thanks emistry!, that was what I'm looking for Quote Link to comment Share on other sites More sharing options...
Question
zmref
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.
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!.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.