Ok so when I dropping the item from my armor the armor unequip is not called so all the stats on the player are getting doubled
here is the code of armor equip/unequip
also there is another dupe bug that if I dropping the "Warden Helmet" from my armor and before I putting armor that gives me speed the item is dropping to the ground and duping to my helmet armor slot too here is the code of this:
here is the code of armor equip/unequip
Code:
on armor equip:
#set {_dl} to line 1 of lore of event-item
set {lore::*} to event-item's lore split at "||"
set {_dl} to {lore::1}
set {_sl} to {lore::2}
set {_fl} to {lore::3}
if {lore::3} contains "Ferocity":
replace all "&7Ferocity: &c+" in {_fl} with ""
else if {lore::3} contains "Speed":
replace all "&7Speed: &a+" in {_fl} with ""
else:
replace all "&7Health: &a+" in {_fl} with ""
replace all "&7Defence: &a+" in {_dl} with ""
replace all "&7Strength: &c+" in {_sl} with ""
replace all "&7Ferocity: &c+" in {_fl} with ""
set {_d} to "%{_dl}%" parsed as an integer
set {_s} to "%{_sl}%" parsed as an integer
set {_f} to "%{_fl}%" parsed as an integer
set {def::%event-player%} to {def::%event-player%} + {_d}
if name of event-item is not "&6Warden Helmet":
set {st::%event-player%} to {st::%event-player%} + {_s}
if {lore::3} contains "Ferocity":
set {fer::%event-player%} to {fer::%event-player%} + {_f}
else if {lore::3} contains "Speed":
set {speed::%event-player%} to {speed::%event-player%} + {_f}
else:
set {hp::%event-player%} to {hp::%event-player%} + {_f}
on armor unequip:
set {lore::*} to event-item's lore split at "||"
set {_dl} to {lore::1}
set {_sl} to {lore::2}
set {_fl} to {lore::3}
if {lore::3} contains "Ferocity":
replace all "&7Ferocity: &c+" in {_fl} with ""
else if {lore::3} contains "Speed":
replace all "&7Speed: &a+" in {_fl} with ""
else:
replace all "&7Health: &a+" in {_fl} with ""
replace all "&7Defence: &a+" in {_dl} with ""
replace all "&7Strength: &c+" in {_sl} with ""
set {_d} to "%{_dl}%" parsed as an integer
set {_s} to "%{_sl}%" parsed as an integer
set {_f} to "%{_fl}%" parsed as an integer
set {def::%event-player%} to {def::%event-player%} - {_d}
if name of event-item is not "&6Warden Helmet":
set {st::%event-player%} to {st::%event-player%} - {_s}
if {lore::3} contains "Ferocity":
set {fer::%event-player%} to {fer::%event-player%} - {_f}
else if {lore::3} contains "Speed":
set {speed::%event-player%} to {speed::%event-player%} - {_f}
else:
set {hp::%event-player%} to {hp::%event-player%} - {_f}
Code:
every 1 tick:
loop all players:
set loop-player's max health to {hp::%loop-player%} / 10
set loop-player's health to {hp::%loop-player%} / 10
if name of loop-player's helmet is "&6Warden Helmet":
set loop-player's walking speed to {speed::%loop-player%} / 1000
set loop-player's flying speed to {speed::%loop-player%} / 1000
set {_h} to loop-player's helmet
set {_st} to ({speed::%loop-player%} / 10) * 150
set {lore::*} to {_h}'s lore split at "||"
set {lore::2} to "&7Strength: &c+%{_st}%"
set line 2 of lore of {_h} to "&7Strength: &c+%{_st}%"
set {lore::*} to {_h}'s lore split at "||"
set {_l} to {lore::2}
replace all "&7Strength: &c+" in {_l} with ""
set {st::%loop-player%::warden} to {_l} parsed as an integer
else:
set {st::%loop-player%::warden} to 0
set loop-player's walking speed to {speed::%loop-player%} / 500
set loop-player's flying speed to {speed::%loop-player%} / 500