Difference between revisions of "Countitem"

From Hercules Wiki
Jump to: navigation, search
(Created page with "Category:Script_Command ==Syntax== *countitem(<itemid>); *countitem("Itemname"); ==Description== Countitem will return the number of items of <itemid> the invok...")
 
m
 
Line 1: Line 1:
[[Category:Script_Command]]
 
 
 
==Syntax==
 
==Syntax==
 
*[[countitem]](<itemid>);
 
*[[countitem]](<itemid>);
Line 22: Line 20:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
[[Category:Script_Command]]

Latest revision as of 22:53, 10 June 2013

Syntax

  • countitem(<itemid>);
  • countitem("Itemname");

Description

Countitem will return the number of items of <itemid> the invoking player holds in his inventory.
Like in getitem, you can also write the name of the item ("Name"-column in ItemDB).

Example

mes "You have "+countitem(501)+"Apples!";
close;
Will print out the number of Apples the char holds...
if(countitem("Apple")>=5){
 mes "This will only print if you have 5 or more Apples!";
 close;
}