Hello everyone, i have kind of got an issue with my code not working properly, so i would hope you lads got help me out with this. The thing here is it is supposed to update the lore of "Upgrade progress" but it isnt quite doing it so.
When an entity attacks the player with the helmet it is supposed to add 250 to {_o} wich needs to make the upgrade progress line to "Upgrade progress: 250 / 500" but it isnt doing that.
However if you put how many {_o}'s the armor piece recieves above the max (So above 500) it does upgrade it to its next level. Wich is wierd. Anyways here is the code for it:
Hope you can help me with this!
When an entity attacks the player with the helmet it is supposed to add 250 to {_o} wich needs to make the upgrade progress line to "Upgrade progress: 250 / 500" but it isnt doing that.
However if you put how many {_o}'s the armor piece recieves above the max (So above 500) it does upgrade it to its next level. Wich is wierd. Anyways here is the code for it:
Hope you can help me with this!
Code:
on damage:
victim is a player
victim's helmet is gold helmet
name of victim's helmet contains "&7Divine Helmet "
lore of victim's helmet contains "&7Rarity: Common"
lore of victim's helmet contains "&7Upgrade Progress: "
set {_I::*} to lore of victim's helmet split at "||"
loop {_I::*}:
if "%loop-value%" contains "&7Upgrade Progress: ":
set {_t} to loop-index parsed as integer
stop loop
set {_I} to "%uncolored {_I::%{_t}%}%"
replace every "Upgrade Progress: " with "" in {_I}
replace every " " with "" in {_I}
set {_A::*} to {_I} split at "/"
set {_O} to {_A::1} parsed as number
set {_P} to {_A::2} parsed as number
if damage is more than 1:
add 250 to {_o}
if {_o} is more than or equal to {_p}:
send "&aYoure weapon just &eEvolved!"
set {_PIECE} to "head"
set {_UUIDLEAST} to 1
set {_UUIDMOST} to 1
set {_Name} to "Divine Helmet"
if {_p} is 500:
set name of victim's helmet to "&7%{_Name}% &a[&6Lv 2&a]"
set the 2nd line of lore of victim's helmet to "&7Armour Defense: &60.26"
set the 4th line of lore of victim's helmet to "&7Upgrade Progress: 0 / 1000"
enchant victim's helmet with protection 1
set {_DF} to 2
add "{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:%{_DF}%,Operation:0,Slot:""%{_PIECE}%"",UUIDLeast:%{_UUIDLEAST}%,UUIDMost:%{_UUIDMOST}%}]}" to nbt of victim's helmet