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.

Solved Remove items from inventory

Discussion in 'Skript' started by Djavan, Jul 25, 2019.

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

    Djavan Member

    Joined:
    Jul 19, 2019
    Messages:
    16
    Likes Received:
    0
    Hey y'all,
    I am making a system what removes items from inventory and adds items to inventory.
    Adding is working but removing not. The error code is below.
    Can someone help me with this please?
    I use Skript and SkQuery.

    Information below


    Skript Version: Skript 2.2-dev36
    Minecraft Version: 1.12.2
    ---
    FIXED CODE
    Code (Text):
    1. else if arg-1 is "take": #TAKE
    2.             if arg-2 is not set:
    3.                 if arg-3 is not set:
    4.                     message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
    5.                 else:
    6.                     remove arg-3 of iron ingot from player's inventory
    7.                     message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"
    8.             else:
    9.                 if arg-3 is not set:
    10.                     message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
    11.                 else:
    12.                     remove arg-3 of iron ingot from player's inventory
    13.                     message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"


    Normal Code
    Code (Text):
    1. else if arg-1 is "take": #TAKE
    2.             if arg-2 is not set:
    3.                 if arg-3 is not set:
    4.                     message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
    5.                 else:
    6.                     remove arg-3 iron ingot from player's inventory
    7.                     message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"
    8.             else:
    9.                 if arg-3 is not set:
    10.                     message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
    11.                 else:
    12.                     remove arg-3 iron ingot from player's inventory
    13.                     message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"
    Error Code
    Code (Text):
    1. > [12:18:06 ERROR]: 'arg-3 iron ingot' can't be removed from an inventory because the former is neither an item type nor an inventory (test.sk, line 187: remove arg-3 iron ingot from player's inventory')
    2. > [12:18:06 ERROR]: 'arg-3 iron ingot' can't be removed from an inventory because the former is neither an item type nor an inventory (test.sk, line 193: remove arg-3 iron ingot from player's inventory')
    [NOTE]
    In this case is line 187: line 6 and line 193: line 12
    --- Double Post Merged, Jul 25, 2019, Original Post Date: Jul 25, 2019 ---
    [EDIT]
    Arg-3 is a amount of cash.
    I want that amount in iron ingots removed from a inventory.
     
    #1 Djavan, Jul 25, 2019
    Last edited: Jul 25, 2019
Thread Status:
Not open for further replies.

Share This Page

Loading...