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.
[doublepost=1587345822,1587333491][/doublepost]bump
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