Pickaxe Upgrade GUI Help

  • 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
So my script lets you open the upgrade menu on right click. I want so players can only upgrade their pickaxes through the GUI but when the pickaxe is clicked, it only closes the menu and nothing else happens.

Code:
on right click:
  if name of player's tool is "&8Wood &7Pickaxe &8[&e1&8]":
    wait 1 tick
    open chest with 3 rows named "&ePickaxe Upgrades" to player
    wait 1 tick
    format slot 10 of player with wooden pickaxe named "&8Wood &7Pickaxe &8[&e2&8]" with lore "" and "&7Cost: &e128 Coal" to close then run [execute console command "/pickaxeupgrade2 %player%"]
 
command /pickaxeupgrade2 <player>:
  permission: op
  trigger:
    if player has 128 coal:
      set slot 2 of player's inventory to 1 wooden pickaxe of efficiency 1 named "&8Wood &7Pickaxe &8[
&e2&8]" with lore "&7Level 2"
      remove 128 coal from arg-1
      remove wooden pickaxe named "&8Wood &7Pickaxe &8[&e1&8]" from arg-1
      play sound "entity.player.levelup" with volume 0.5
    else:
      send "&cYou dont have 128 Coal to upgrade your pick!"
      play sound "block.anvil.place" with volume 0.5
[doublepost=1587345822,1587333491][/doublepost]bump
 
So my script lets you open the upgrade menu on right click. I want so players can only upgrade their pickaxes through the GUI but when the pickaxe is clicked, it only closes the menu and nothing else happens.

Code:
on right click:
  if name of player's tool is "&8Wood &7Pickaxe &8[&e1&8]":
    wait 1 tick
    open chest with 3 rows named "&ePickaxe Upgrades" to player
    wait 1 tick
    format slot 10 of player with wooden pickaxe named "&8Wood &7Pickaxe &8[&e2&8]" with lore "" and "&7Cost: &e128 Coal" to close then run [execute console command "/pickaxeupgrade2 %player%"]
 
command /pickaxeupgrade2 <player>:
  permission: op
  trigger:
    if player has 128 coal:
      set slot 2 of player's inventory to 1 wooden pickaxe of efficiency 1 named "&8Wood &7Pickaxe &8[
&e2&8]" with lore "&7Level 2"
      remove 128 coal from arg-1
      remove wooden pickaxe named "&8Wood &7Pickaxe &8[&e1&8]" from arg-1
      play sound "entity.player.levelup" with volume 0.5
    else:
      send "&cYou dont have 128 Coal to upgrade your pick!"
      play sound "block.anvil.place" with volume 0.5
[doublepost=1587345822,1587333491][/doublepost]bump

Pls don't use skquery inventory's read this: https://forums.skunity.com/threads/vanilla-guis.8939/#post-47928
 
Status
Not open for further replies.