removing normal and named items

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

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
47
Hey there, i got a weird situation.
I got this code:

code_language.skript:
on right-click on sign:
    loop all blocks in radius 2 of event-block:
        if loop-block is chest or trapped chest:   
            if 1st line is set:
                set {_buy.%event-block%} to "%line 1 of event-block%" parsed as a number
                loop all items in player's inventory:
                    if type of loop-item is a sunflower:
                        add amount of item loop-item to {_coins}
                if {_coins} is set:
                    if {_coins} is greater than or equal to {_buy.%event-block%}:
                        remove {_buy.%event-block%} of sunflower from player's inventory
                        loop all items in loop-block's inventory:
                            add loop-item to {_get::*}
                        add {_get::*} to player's inventory

Which works, but only for normal unnamed and unlored items. But what i want is that it will also work with sunflowers with a name and a lore.
Can you guys help me out here?
 
Hey there, i got a weird situation.
I got this code:

code_language.skript:
on right-click on sign:
    loop all blocks in radius 2 of event-block:
        if loop-block is chest or trapped chest:  
            if 1st line is set:
                set {_buy.%event-block%} to "%line 1 of event-block%" parsed as a number
                loop all items in player's inventory:
                    if type of loop-item is a sunflower:
                        add amount of item loop-item to {_coins}
                if {_coins} is set:
                    if {_coins} is greater than or equal to {_buy.%event-block%}:
                        remove {_buy.%event-block%} of sunflower from player's inventory
                        loop all items in loop-block's inventory:
                            add loop-item to {_get::*}
                        add {_get::*} to player's inventory

Which works, but only for normal unnamed and unlored items. But what i want is that it will also work with sunflowers with a name and a lore.
Can you guys help me out here?

I think you need to save the name and the lore of the sunflower
 
Status
Not open for further replies.