Solved Vanilla GUI If player has item

  • 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.

Jerooski

Member
Apr 19, 2020
16
0
0
25
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:
on inventory click:
   if event-slot is wooden pickaxe named "&8Wooden &7Pickaxe &8[&e2&8]":
      if player has 128 coal:
         give wooden pickaxe named "&8Wooden &7Pickaxe &8[&e2&8]" to player
         remove 128 coal from player
         remove wooden pickaxe named "&8Wooden &7Pickaxe &8[&e1&8]" from player
         close player's inventory
      else:
         send "&c&lSorry! You dont have the resources to upgrade this item!"
         close player's inventory
   if event-inventory is not player's inventory:
      cancel event
 
Last edited:
Status
Not open for further replies.