Solved Getting lore and setting value

  • 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 community!

    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!

Meggy_Mode

Active Member
Aug 30, 2024
206
8
18
It worked correct but after i updated my server (and plugins) to 1.21 it does not work anymore

code_language.skript:
on damage:
    set {_Prot} to 0
    if victim is wearing a helmet:
        set {_split::*} to split 1st line of lore of victim's helmet by "Defence:&a +"
        set {_n} to {_split::2} parsed as a number
        add {_n} to {_Prot}

anyone know whats going on???
 
Fixed it ish

now the problem is the atribute wont set


code_language.skript:
on block damage:
    set {_MiningSpeed} to 0
    if player is holding a pickaxe:
        set {_loreLine} to 2nd line of lore of player's tool
        set {_split::*} to split {_loreLine} by "&7Mining Speed:&a +"
        if {_split::2} is set:
            set {_n} to {_split::2} parsed as a number
            add {_n} to {_MiningSpeed}
            apply attribute modifier to player:
                attribute: block break speed
                id: "block_break_speed"
                amount: {_MiningSpeed}
                operation: add_number
        else:
            send "Failed to split lore or retrieve the number.\nPlease notify an Admin" to player