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

Discussion in 'Skript' started by Pqngs, May 28, 2021.

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

    Pqngs Member

    Joined:
    May 28, 2021
    Messages:
    11
    Likes Received:
    0
    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 (Text):
    1. on inventory click:
    2.     if name of event-inventory is "&8Are you sure?":
    3.         if event-item is lime wool:
    4.             close player's inventory
    5.             cancel event
    6.             remove {pickcost::*} coal from player's inventory # <- the problematic line
    7.             add 1 to {pick::*}
    8.             set {nextpick::*} to {pick::*}
    9.             add 1 to {nextpick::*}
    10.             play sound "entity.experience_orb.pickup" to player
    11.             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.
     
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    Yes, because it's a list. How did you set the variable?
     
  3. Pqngs

    Pqngs Member

    Joined:
    May 28, 2021
    Messages:
    11
    Likes Received:
    0
    Oh no worries! I figured it out. Although i have another problem i'll be making another thread for it.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...