Solved Getting custom item in a quantity

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

Wynnevir

Well-Known Member
Jul 9, 2017
1,015
62
48
30
Elsewhere
I'm having issues referencing a custom item in a quantity greater than 1. for example this works:
Code:
command /invtest:
    trigger:
        if player's inventory contains player head named "test":
        #if player's inventory contains {test}:  <--also works
            send "success"
        else:
            send "falied"
But it stops working when you have more than one of the item. I've tried to loop the items, add them to a list split at " " to separate the number and such, but it can't recognize a loop-value or item in that instance. I found just setting the item to a variable works best for me because it has quite a bit of lore and that just saves it all.
My end goal is to have it return the one item to the player on death, but it can not find it in the drops either(this happens even with only 1 item so a separate issue i image lol).
Any ideas? I've been wrestling with it for a week or so now.
[doublepost=1595204811,1595201605][/doublepost]I fixed it shortly after posting, all it needed was for me to complain about it haha.

for any interested

Code:
on death:
    loop player's inventory:
        loop-value is {item}
        add loop-value to {_list::*}
        remove {_list::*} from drops
    wait 5 ticks
    add {_list::*} to player's inventory
 
Status
Not open for further replies.