Bugg with removing 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
46
Hey there,

I updated to the latest version of skript lately: 2.4.1
But i got a line of code that is not working correctly:

Code:
command /remove:
    trigger:
        send "%held item%"
        remove 1 of held item from player's inventory

If i have a barrier ( or any other item ) in my hand, with a name like "Barrier101", and i run the command, a normal barrier will get removed if that barrier is before my held item in the inventory.

While it is supposed to just remove the barrier in my hand because of the name.

Is there a fix for this problem?
 
Hey there,

I updated to the latest version of skript lately: 2.4.1
But i got a line of code that is not working correctly:

Code:
command /remove:
    trigger:
        send "%held item%"
        remove 1 of held item from player's inventory

If i have a barrier ( or any other item ) in my hand, with a name like "Barrier101", and i run the command, a normal barrier will get removed if that barrier is before my held item in the inventory.

While it is supposed to just remove the barrier in my hand because of the name.

Is there a fix for this problem?
If you just want to remove 1 from the item the player is holding, try `remove 1 from item amount of tool of player`
 
Try this :emoji_wink:

Code:
command /remove:
    trigger:
        set {removing.item} to player's held item
        remove {removing.item} from player's inventory

I tried this, but it will result in the same problem
[doublepost=1577448709,1577448659][/doublepost]
If you just want to remove 1 from the item the player is holding, try `remove 1 from item amount of tool of player`

I want it to remove 1 of player's held item item, so if the same item is somewhere else in the inventory before the current held item, i want it to remove the first one first
 
I tried this, but it will result in the same problem
[doublepost=1577448709,1577448659][/doublepost]

I want it to remove 1 of player's held item item, so if the same item is somewhere else in the inventory before the current held item, i want it to remove the first one first
It's probably a Skript bug (#2714). You will have to loop over the items manually, checking their item type, then checking name, then lore etc.
 
Status
Not open for further replies.