Solved check item lore in inventory how?

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

BrownMee

Active Member
Apr 16, 2018
126
6
18
23
How do I check specific lore or name in the item?
if player's inventory contains 1 of porkchop named "&7Meat":

doesn't work if there is lore in the "&7Meat". How can I check without checking lore
 
code_language.skript:
loop all items in player's inventory:
    if name of loop-item is "&7Meat":
        # do stuff
        stop
 
Last edited:
There's no loop that matches loop item error
code_language.skript:
loop all items in player's inventory:
    if name of loop-item is "&7Meat":
        set {_amount} to amount of loop-item in player's inventory
        if {_amount} is greater than 0:
            # do stuff
        stop loop
 
Last edited:
code_language.skript:
loop all items in player's inventory:
    if name of loop-item is "&7Meat":
        set {_amount} to item amount of loop-item in player's inventory
        if {_amount} is greater than 0:
            # do stuff
        stop loop
This is the error using the code
[15:37:50 ERROR]: There's no loop that matches 'loop-item in player' (custom.sk, line 26: set {_amount} to item amount of loop-item in player's current inventory')
 
This is the error using the code
[15:37:50 ERROR]: There's no loop that matches 'loop-item in player' (custom.sk, line 26: set {_amount} to item amount of loop-item in player's current inventory')
Oops, that was my bad. Remove `item`, it should be:
code_language.skript:
set {_amount} to amount of loop-item in player's inventory
 
Status
Not open for further replies.