Solved Weird inventory contains behaviour

  • 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.
Jan 19, 2018
18
1
3
Skript Version: 2.2-dev34
Skript Author: Njol, Mirreski, bensku, TheBentoBox, tim740, Tuke-Nnuke, TheLimeGlass, xXAndrew28Xx, Sashie, RoyCurtis, nfell2009, Syst3ms and Snow-Pyon
Minecraft Version: 1.12.2

---

Full Code:

code_language.skript:
command /test [<integer>]:
    trigger:
        set {_currency::coal} to coal:0 named "&8Coal &7[&a1&7]"
        set {_sell} to "coal"
        broadcast "1. %{_sell}%"
        set {_sell-amount} to 9
        broadcast "2.1. %{_sell}%"
        broadcast "2.2. %{_sell-amount}%"
        set {_sell} to {_sell-amount} of {_currency::%{_sell}%}
        broadcast "3.1. %{_sell}%"
        broadcast "3.2. %{_sell-amount}%"
        if arg 1 is set:
            give {_sell} to player
        if player's inventory contains {_sell}:
            send "&aTrue."
        else:
            send "&cFalse."

Errors on Reload:
None.

Console Errors:
None.

Other Useful Info:
Doing "/test" will broadcast some info and check if you have a certain item in your inventory.
Doing "/test 1" will give you the item you are supposed to have and then check if your inventory contains it, but for some reason this does not work...

Addons using (including versions):
I am not sure if the script I have provided is using any addons, but I will list the ones installed.

skDragon (0.14.0)
SkQuery (3.6.0-Lime)
Skellett (1.9.4a)
TuSKe (1.8.2)

Troubleshooting:
Don't know what I am supposed to put here...

Have you tried searching the docs? N/A, not searching for a condition, effect, etc.
Have you tried searching the forums? No, but I have searched google and have not found a sollution.
What other methods have you tried to fix it?
I have tried putting it directly as an item, but skript makes the mistake of thinking it is a list(I am using a trade item function, it takes buy and sell, with comma separated.) I also tried putting a void variable between those 2, still does not work.

Tried parsing text as item, but it does not register the item's names.
 
Last edited:
Uh, oh, whoops, forgot a part.. I will edit the code, there was supposed to be another effect after that :emoji_stuck_out_tongue:
[doublepost=1533380056,1533379833][/doublepost]Heck.. nevermind, you confused me there... @ShaneBee, please look at the full code, the variable is set later :/
[doublepost=1533380204][/doublepost]
upload_2018-8-4_16-15-6.png

Maybe someone could try that code? I'm having no luck getting it to work... As you can see on the right, I have coal named what it wants (Seen in the actionbar), but it still doesn't work.
 
I can't try anything right now, but I think I have a solution.. Maybe I can just wrap the items in the function around brackets like this:
functionName((<item>), (<item>))
I will try later
[doublepost=1534052923,1533983232][/doublepost]Ooh, great! The 'player has "%{_sell}%" parsed as itemtype' works.
 
I can't try anything right now, but I think I have a solution.. Maybe I can just wrap the items in the function around brackets like this:
functionName((<item>), (<item>))
I will try later
[doublepost=1534052923,1533983232][/doublepost]Ooh, great! The 'player has "%{_sell}%" parsed as itemtype' works.
Awesome :emoji_slight_smile: glad it worked
 
Status
Not open for further replies.