1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bugg with removing items

Discussion in 'Skript' started by SoMuchWessel, Dec 26, 2019.

Thread Status:
Not open for further replies.
  1. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    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 (Text):
    1. command /remove:
    2.     trigger:
    3.         send "%held item%"
    4.         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?
     
  2. TheCringleYT

    TheCringleYT Active Member

    Joined:
    Sep 29, 2019
    Messages:
    194
    Likes Received:
    4
    Try this :emoji_wink:

    Code (Text):
    1. command /remove:
    2.     trigger:
    3.         set {removing.item} to player's held item
    4.         remove {removing.item} from player's inventory
     
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    If you just want to remove 1 from the item the player is holding, try `remove 1 from item amount of tool of player`
     
  4. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    I tried this, but it will result in the same problem
    --- Double Post Merged, Dec 27, 2019, Original Post Date: Dec 27, 2019 ---
    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
     
  5. TheCringleYT

    TheCringleYT Active Member

    Joined:
    Sep 29, 2019
    Messages:
    194
    Likes Received:
    4
    Try looking on the Documentation or SkriptHub (skripthub.net) for further help
     
  6. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    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.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...