Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function enchanterOpen(p: player):
- execute console command "playsound minecraft:entity.bat.takeoff master %{_p}% ~ ~ ~ 100000 1"
- wait 1 tick
- if lore of {_p}'s tool isn't set:
- set lore of {_p}'s tool to " "
- if lore of {_p}'s tool doesn't contain "Haste":
- format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&e$40,000||&7||&7Adds some speed to your pickaxe!||&7" to run function enchanterEnchant({_p}, "Haste I", 40000, 10)
- else if lore of {_p}'s tool contains "&eHaste I&e":
- format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&e$75,000||&7||&7Adds some speed to your pickaxe!||&7" to run function enchanterEnchant({_p}, "Haste II", 75000, 10)
- else if lore of {_p}'s tool contains "&eHaste II&e":
- format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&7MAX LEVEL||&7"
- on inventory click:
- name of player's current inventory is "Pickaxe Enchanter"
- cancel event
- function enchanterEnchant(p: player, e: String, n: Number, s: Number):
- if {_p}'s tool is a pickaxe:
- if {_e} is "Haste I":
- if {_p}'s balance is greater than {_n} - 1:
- remove {_n} from {_p}'s balance
- set lore of {_p}'s tool to "%lore of {_p}'s tool%||&e%{_e}%&e"
- execute console command "playsound entity.player.levelup master %{_p}% ~ ~ ~ 100000000 2"
- else:
- close {_p}'s inventory
- execute console command "/playsound minecraft:entity.blaze.hurt master %{_p}% ~ ~ ~ 100000000 1.3"
- send "&cYou need atleast $%{_n}% to enchant your pickaxe with %{_e}%!" to {_p}
- if {_e} is "Haste II":
- if {_p}'s balance is greater than {_n} - 1:
- remove {_n} from {_p}'s balance
- replace all "Haste I" in lore of {_p}'s tool with "Haste II"
- execute console command "playsound entity.player.levelup master %{_p}% ~ ~ ~ 100000000 2"
- else:
- close {_p}'s inventory
- execute console command "/playsound minecraft:entity.blaze.hurt master %{_p}% ~ ~ ~ 100000000 1.3"
- send "&cYou need atleast $%{_n}% to enchant your pickaxe with %{_e}%!" to {_p}
- if lore of {_p}'s tool doesn't contain "Haste":
- format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&e$40,000||&7||&7Adds some speed to your pickaxe!||&7" to run function enchanterEnchant({_p}, "Haste I", 40000, 10)
- else if lore of {_p}'s tool contains "&eHaste I&e":
- format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&e$75,000||&7||&7Adds some speed to your pickaxe!||&7" to run function enchanterEnchant({_p}, "Haste II", 75000, 10)
- else if lore of {_p}'s tool contains "&eHaste II&e":
- format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&7MAX LEVEL||&7"
- else:
- send "&cYou must be holding a Pickaxe!" to {_p}
- close {_p}'s inventory
- execute console command "/playsound minecraft:entity.blaze.hurt master %{_p}% ~ ~ ~ 100000000 1.3"
- on rightclick on enchantment_table:
- cancel event
- open chest with 4 rows named "Pickaxe Enchanter" to player
- enchanterOpen(player)
- every tick:
- loop all players:
- if lore of loop-player's tool contains "&eHaste I&e":
- apply potion of haste 1 to loop-player for 0.1 seconds
- else if lore of loop-player's tool contains "&eHaste II":
- apply potion of haste 2 to loop-player for 0.1 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement