Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. function enchanterOpen(p: player):
  2. execute console command "playsound minecraft:entity.bat.takeoff master %{_p}% ~ ~ ~ 100000 1"
  3. wait 1 tick
  4. if lore of {_p}'s tool isn't set:
  5. set lore of {_p}'s tool to " "
  6. if lore of {_p}'s tool doesn't contain "Haste":
  7. 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)
  8. else if lore of {_p}'s tool contains "&eHaste I&e":
  9. 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)
  10. else if lore of {_p}'s tool contains "&eHaste II&e":
  11. format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&7MAX LEVEL||&7"
  12.  
  13. on inventory click:
  14. name of player's current inventory is "Pickaxe Enchanter"
  15. cancel event
  16.  
  17. function enchanterEnchant(p: player, e: String, n: Number, s: Number):
  18. if {_p}'s tool is a pickaxe:
  19. if {_e} is "Haste I":
  20. if {_p}'s balance is greater than {_n} - 1:
  21. remove {_n} from {_p}'s balance
  22. set lore of {_p}'s tool to "%lore of {_p}'s tool%||&e%{_e}%&e"
  23. execute console command "playsound entity.player.levelup master %{_p}% ~ ~ ~ 100000000 2"
  24. else:
  25. close {_p}'s inventory
  26. execute console command "/playsound minecraft:entity.blaze.hurt master %{_p}% ~ ~ ~ 100000000 1.3"
  27. send "&cYou need atleast $%{_n}% to enchant your pickaxe with %{_e}%!" to {_p}
  28. if {_e} is "Haste II":
  29. if {_p}'s balance is greater than {_n} - 1:
  30. remove {_n} from {_p}'s balance
  31. replace all "Haste I" in lore of {_p}'s tool with "Haste II"
  32. execute console command "playsound entity.player.levelup master %{_p}% ~ ~ ~ 100000000 2"
  33. else:
  34. close {_p}'s inventory
  35. execute console command "/playsound minecraft:entity.blaze.hurt master %{_p}% ~ ~ ~ 100000000 1.3"
  36. send "&cYou need atleast $%{_n}% to enchant your pickaxe with %{_e}%!" to {_p}
  37. if lore of {_p}'s tool doesn't contain "Haste":
  38. 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)
  39. else if lore of {_p}'s tool contains "&eHaste I&e":
  40. 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)
  41. else if lore of {_p}'s tool contains "&eHaste II&e":
  42. format gui slot 10 of {_p} with a gold pickaxe named "&6Haste" with lore "||&7MAX LEVEL||&7"
  43. else:
  44. send "&cYou must be holding a Pickaxe!" to {_p}
  45. close {_p}'s inventory
  46. execute console command "/playsound minecraft:entity.blaze.hurt master %{_p}% ~ ~ ~ 100000000 1.3"
  47.  
  48. on rightclick on enchantment_table:
  49. cancel event
  50. open chest with 4 rows named "Pickaxe Enchanter" to player
  51. enchanterOpen(player)
  52.  
  53. every tick:
  54. loop all players:
  55. if lore of loop-player's tool contains "&eHaste I&e":
  56. apply potion of haste 1 to loop-player for 0.1 seconds
  57. else if lore of loop-player's tool contains "&eHaste II":
  58. apply potion of haste 2 to loop-player for 0.1 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement