Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. #
  2. # Equip/Unequip
  3. #
  4.  
  5. every 3 ticks:
  6. loop {acooldown::*}:
  7. if loop-value > 0:
  8. subtract 1 from {acooldown::%loop-index%}
  9. else:
  10. delete {acooldown::%loop-index%}
  11.  
  12. on inventory click:
  13. if index of event-slot is 17, 26 or 35:
  14. if {acooldown::%player%} is not set:
  15. set {_var::*} to getItems()
  16. if {_var::*} contains type of cursor slot of player:
  17. equipAcc(player, type of cursor slot of player)
  18. else:
  19. unequip(player, type of clicked slot)
  20. set {acooldown::%player%} to 1
  21. else:
  22. send "&7You're equipping too fast!"
  23.  
  24. function getItems() :: items:
  25. return lapis lazuli, stone and iron helmet
  26.  
  27. function equipAcc(p: player, i: item):
  28. if {_i} is lapis lazuli:
  29. if {accessories::nw::*} does not contain {_p}:
  30. add {_p} to {accessories::nw::*}
  31. send "&7Equipped Night Ward" to {_p}
  32. activate("nightward", {_p}, 1)
  33.  
  34. function unequip(p: player, i: item):
  35. if {_i} is lapis lazuli:
  36. if {accessories::nw::*} contains {_p}:
  37. remove {_p} from {accessories::nw::*}
  38. send "&7Unequipped Night Ward" to {_p}
  39. activate("nightward", {_p}, 0)
  40.  
  41. function activate(t: text, p: offlineplayer, s: integer):
  42. broadcast "&7active1: %{active::nw::*}%"
  43. broadcast "&7equipped: %{accessories::nw::*}%"
  44. if {_t} = "nightward":
  45. if {_s} = 1:
  46. if {active::nw::*} does not contain {_p}:
  47. add {_p} to {active::nw::*}
  48. add 3 to {maxhealth::%{_u}%}
  49. if {_s} = 0:
  50. if {active::nw::*} contains {_p}:
  51. remove {_p} from {active::nw::*}
  52. remove 3 from {maxhealth::%{_u}%}
  53. set {_p}'s max health to {maxhealth::%{_u}%}
  54. broadcast "&7active2: %{active::nw::*}%"
  55.  
  56.  
  57.  
  58. #
  59. # Accessory Events
  60. #
  61.  
  62. on join:
  63. set {maxhealth::%uuid of player%} to 10 if {maxhealth::%uuid of player%} is not set
  64. wait 2 ticks
  65. activate("nightward", player, {night})
  66.  
  67. at 19:00 in "ul_prox":
  68. set {night} to 1
  69. loop {accessories::nw::*}:
  70. activate("nightward", loop-value, 1)
  71.  
  72. at 5:30 in "ul_prox":
  73. set {night} to 0
  74. loop {active::nw::*}:
  75. activate("nightward", loop-value, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement