USING VANILLA GUIS
Current Addons: Skellet, SkRayFall, TuSke
I'm setting up a pickaxe upgrade system. They right click their current pick so it opens the gui and they can purchase the following tier. However, my script is stuck and only works with the first tier. When I open up the second pick tier, when bought, it gives you the first tier prices, cost, and item. How can I have multiple pickaxe tiers, while keeping the script as short as possible and have multiple GUIS. (that also dont happen to have items stealable by players)
Current Addons: Skellet, SkRayFall, TuSke
I'm setting up a pickaxe upgrade system. They right click their current pick so it opens the gui and they can purchase the following tier. However, my script is stuck and only works with the first tier. When I open up the second pick tier, when bought, it gives you the first tier prices, cost, and item. How can I have multiple pickaxe tiers, while keeping the script as short as possible and have multiple GUIS. (that also dont happen to have items stealable by players)
Code:
#---WPICKAXE 1--#
on right click:
if player's held item is wooden pickaxe of efficiency 1 named "&8Wooden &7Pickaxe &8[&e1&8]":
open chest inventory with 3 rows named "Pick1" to player
loop 27 times:
set slot (loop-number -1) of player' current inventory to black stained glass pane named " "
set slot 13 of player's current inventory to wooden pickaxe of efficiency 2 named "&8Wooden &7Pickaxe &8[&e2&8]" with lore " " and "&7Costs: &e50 Coal"
on inventory click:
if clicked slot is 13:
if player has 50 coal:
give wooden pickaxe of efficiency 2 named "&8Wooden &7Pickaxe &8[&e2&8]" to player
remove 50 coal from player
remove wooden pickaxe of efficiency 1 named "&8Wooden &7Pickaxe &8[&e1&8]" from player
close player's inventory
else:
send "&c&lSorry! You need &e50 Coal"
close player's inventory
if event-inventory is not player's inventory:
cancel event
#---WPICKAXE 2--#
on right click:
if player's held item is wooden pickaxe of efficiency 2 named "&8Wooden &7Pickaxe &8[&e2&8]":
open chest inventory with 3 rows named "Pick2" to player
loop 27 times:
set slot (loop-number -1) of player' current inventory to black stained glass pane named " "
set slot 13 of player's current inventory to wooden pickaxe of efficiency 3 named "&8Wooden &7Pickaxe &8[&e3&8]" with lore " " and "&7Costs: &e150 Coal"
on inventory click:
if clicked slot is 13:
if player has 150 coal:
give wooden pickaxe of efficiency 3 named "&8Wooden &7Pickaxe &8[&e3&8]" to player
remove 150 coal from player
remove wooden pickaxe of efficiency 2 named "&8Wooden &7Pickaxe &8[&e2&8]" from player
close player's inventory
else:
send "&c&lSorry! You need &e150 Coal"
close player's inventory
if event-inventory is not player's inventory:
cancel event