Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Equip/Unequip
- #
- every 3 ticks:
- loop {acooldown::*}:
- if loop-value > 0:
- subtract 1 from {acooldown::%loop-index%}
- else:
- delete {acooldown::%loop-index%}
- on inventory click:
- if index of event-slot is 17, 26 or 35:
- if {acooldown::%player%} is not set:
- set {_var::*} to getItems()
- if {_var::*} contains type of cursor slot of player:
- equipAcc(player, type of cursor slot of player)
- else:
- unequip(player, type of clicked slot)
- set {acooldown::%player%} to 1
- else:
- send "&7You're equipping too fast!"
- function getItems() :: items:
- return lapis lazuli, stone and iron helmet
- function equipAcc(p: player, i: item):
- if {_i} is lapis lazuli:
- if {accessories::nw::*} does not contain {_p}:
- add {_p} to {accessories::nw::*}
- send "&7Equipped Night Ward" to {_p}
- activate("nightward", {_p}, 1)
- function unequip(p: player, i: item):
- if {_i} is lapis lazuli:
- if {accessories::nw::*} contains {_p}:
- remove {_p} from {accessories::nw::*}
- send "&7Unequipped Night Ward" to {_p}
- activate("nightward", {_p}, 0)
- function activate(t: text, p: offlineplayer, s: integer):
- broadcast "&7active1: %{active::nw::*}%"
- broadcast "&7equipped: %{accessories::nw::*}%"
- if {_t} = "nightward":
- if {_s} = 1:
- if {active::nw::*} does not contain {_p}:
- add {_p} to {active::nw::*}
- add 3 to {maxhealth::%{_u}%}
- if {_s} = 0:
- if {active::nw::*} contains {_p}:
- remove {_p} from {active::nw::*}
- remove 3 from {maxhealth::%{_u}%}
- set {_p}'s max health to {maxhealth::%{_u}%}
- broadcast "&7active2: %{active::nw::*}%"
- #
- # Accessory Events
- #
- on join:
- set {maxhealth::%uuid of player%} to 10 if {maxhealth::%uuid of player%} is not set
- wait 2 ticks
- activate("nightward", player, {night})
- at 19:00 in "ul_prox":
- set {night} to 1
- loop {accessories::nw::*}:
- activate("nightward", loop-value, 1)
- at 5:30 in "ul_prox":
- set {night} to 0
- loop {active::nw::*}:
- activate("nightward", loop-value, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement