Solved Removing a variable of an item from the player's (error) 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.

Pqngs

Member
May 28, 2021
11
0
1
23
I am trying to make a simple shop skript so when you buy an item it removes a specified price of coal (in this case) from your inventory.
But it doesn't work.
Code:
on inventory click:
    if name of event-inventory is "&8Are you sure?":
        if event-item is lime wool:
            close player's inventory
            cancel event
            remove {pickcost::*} coal from player's inventory # <- the problematic line
            add 1 to {pick::*}
            set {nextpick::*} to {pick::*}
            add 1 to {nextpick::*}
            play sound "entity.experience_orb.pickup" to player
            send "&aYou successfully upgraded your pickaxe to tier&2 %amount of {pick::*}%&7."

ERROR:
{pickcost::*} amount of coal can't be removed from an inventory because the former is neither an item type nor an inventory

NOTE: It worked when it was just a number of coal, not a variable of coal.
 
Oh no worries! I figured it out. Although i have another problem i'll be making another thread for it.
 
Status
Not open for further replies.