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 Vanilla GUI If player has item

Discussion in 'Skript' started by Jerooski, Apr 21, 2020.

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

    Jerooski Member

    Joined:
    Apr 19, 2020
    Messages:
    16
    Likes Received:
    0
    Im trying to make it so when a player clicks on the gui item, it "upgrades" the current item. Im using vanilla GUIS. Nothing happens when the item is clicked.
    Code (Text):
    1. on inventory click:
    2.    if event-slot is wooden pickaxe named "&8Wooden &7Pickaxe &8[&e2&8]":
    3.       if player has 128 coal:
    4.          give wooden pickaxe named "&8Wooden &7Pickaxe &8[&e2&8]" to player
    5.          remove 128 coal from player
    6.          remove wooden pickaxe named "&8Wooden &7Pickaxe &8[&e1&8]" from player
    7.          close player's inventory
    8.       else:
    9.          send "&c&lSorry! You dont have the resources to upgrade this item!"
    10.          close player's inventory
    11.    if event-inventory is not player's inventory:
    12.       cancel event
     
    #1 Jerooski, Apr 21, 2020
    Last edited: Apr 21, 2020
Thread Status:
Not open for further replies.

Share This Page

Loading...