Solved Remove items from inventory

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

Djavan

Member
Jul 19, 2019
16
0
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:
else if arg-1 is "take": #TAKE
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
                else:
                    remove arg-3 of iron ingot from player's inventory
                    message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"
            else:
                if arg-3 is not set:
                    message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
                else:
                    remove arg-3 of iron ingot from player's inventory
                    message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"



Normal Code
Code:
else if arg-1 is "take": #TAKE
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
                else:
                    remove arg-3 iron ingot from player's inventory
                    message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"
            else:
                if arg-3 is not set:
                    message "&e&lMONEY&r &e- &cYou had not set the cash argument!"
                else:
                    remove arg-3 iron ingot from player's inventory
                    message "&e&lMONEY&r &e- &c%arg-3%&e cash was taken from you!"

Error Code
Code:
> [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')
> [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
[doublepost=1564053870,1564049973][/doublepost][EDIT]
Arg-3 is a amount of cash.
I want that amount in iron ingots removed from a inventory.
 
Last edited:
Status
Not open for further replies.