Solved Check if player has item in 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 community!

    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.

DieserTicket

New Member
Feb 11, 2019
9
0
0
Hey, ich wanted to check if a player has an Item in his inventory.
The Problem is: The Item i search in his inventory is a variable. I want to search an item which i didnt set in the script. I want to set the item ingame with a variable but it says "'1 {item}' is not an entity type (myscript.sk, line 31: if player has 1 {item}:')"

heres the part of the script
Code:
command /buythatshit [<integer>]:
    trigger:
        if arg-1 is set:
            if arg-1 is bigger than 14:
                stop
            if arg-1 is smaller than 1:
                stop
            if player has 1 {verkaufstimes.%arg-1%}:
                remove 1 {verkaufstimes.%arg-1%} from player
                message "&7Du hast &c1x &b%{verkaufstimes.%arg-1%}% &7verkauft! &a+%{preis.verkaufstimes.%arg-1%}%"
                add {preis.verkaufsitems.%arg-1%} to {tokens.%player%}
                stop
            else:
                message "&cDu hast dieses Item nicht im Inventar!"

Sorry for my bad english btw
 
Status
Not open for further replies.