Armor lore not registering

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

WiebeHero

Active Member
Aug 23, 2017
135
5
0
23
Hello everyone WiebeHero here! So i have been working with tools and nbt and lore a lot and i wanted to try it out with armor! But sadly it didnt work out really, the thing is it loads no errors but it doesnt update the lore or do anything with it.
What it is supposed to do is if you get above 0 damage damaged it is suposed to count 2 up {_o} but it doesnt do that. Here is the code:
Code:
on damage:
    victim is a player
    victim's item is golden 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 0:
        add 2 to {_o}
    if {_o} is more than or equal to {_p}:
        send "&aYoure armor just &eEvolved!"
        if {_p} is 500:
            give victim unbreakable golden helmet with nbt "{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:0.50,Operation:0,Slot:""head"",UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "&7---------------------||&7Armor Defense: 0.50||&7---------------------||&7Upgrade Progress: 0 / 1000||&7Rarity: Common"
           
       
command /DivineHelmet1:
    trigger:
        give player unbreakable golden helmet with nbt "{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:0.40,Operation:0,Slot:""head"",UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "&7---------------------||&7Armor Defense: 0.50||&7---------------------||&7Upgrade Progress: 0 / 500||&7Rarity: Common"
[doublepost=1518948404,1518894962][/doublepost]Please guys! Help me with this if it helps. It DOES work when i change ''Victim'' to "Attacker" and change the helmet and item to held item then it does work but only when you attack with the helmet....
 
Hello everyone WiebeHero here! So i have been working with tools and nbt and lore a lot and i wanted to try it out with armor! But sadly it didnt work out really, the thing is it loads no errors but it doesnt update the lore or do anything with it.
What it is supposed to do is if you get above 0 damage damaged it is suposed to count 2 up {_o} but it doesnt do that. Here is the code:
Code:
on damage:
    victim is a player
    victim's item is golden 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 0:
        add 2 to {_o}
    if {_o} is more than or equal to {_p}:
        send "&aYoure armor just &eEvolved!"
        if {_p} is 500:
            give victim unbreakable golden helmet with nbt "{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:0.50,Operation:0,Slot:""head"",UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "&7---------------------||&7Armor Defense: 0.50||&7---------------------||&7Upgrade Progress: 0 / 1000||&7Rarity: Common"
          
      
command /DivineHelmet1:
    trigger:
        give player unbreakable golden helmet with nbt "{AttributeModifiers:[{AttributeName:""generic.armor"",Name:""armor"",Amount:0.40,Operation:0,Slot:""head"",UUIDLeast:1,UUIDMost:1}]}" named "&7Divine Helmet [Lv 1]" with lore "&7---------------------||&7Armor Defense: 0.50||&7---------------------||&7Upgrade Progress: 0 / 500||&7Rarity: Common"
[doublepost=1518948404,1518894962][/doublepost]Please guys! Help me with this if it helps. It DOES work when i change ''Victim'' to "Attacker" and change the helmet and item to held item then it does work but only when you attack with the helmet....

It doesn't look like you're ever actually updating the lore of the item to the latest progress of it
 
Status
Not open for further replies.