number of item

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

xbxy

Active Member
Jan 26, 2017
170
8
0
28
Code:
set {_test::1} to 10 egg
set {_test::2} to 20 egg named "test egg"

loop {_test::*}
    give loop-value to player
wait 1 ticks
set {_t} to number of {_test::1} in player's inventory
set {_tt} to number of {_test::2} in player's inventory
send "%{_t}%"
send "%{_tt}%"

{_t} = 30
{_tt} = 20
This is the {_t}
It's the total number of eggs
How do I get him to be 10 ?
 
I mean one of them has no custom name or lore
It is an original item
I just want to get the number of original items
If you're using the Bensku's fork (dev21 and up IIRC) you can do this:
code_language.skript:
loop items in player's inventory:
    if loop-item is an egg named "test egg":
        set {_amount} to item amount of loop-item
Shorter way with skQuery:
code_language.skript:
loop items in player's inventory where [item input is an egg named "test egg"]:
    set {_amount} to item amount of loop-item
Even shorter way with MundoSK:
code_language.skript:
set {_amount} to item amount of items in player's inventory that are egg named "test egg"
 
Status
Not open for further replies.