Checking the number in line of item's lore

  • 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.

EndyHell

Member
Dec 11, 2019
1
0
0
23
Hello. I'm trying to create skript that checks if line of the item's lore with given text exists and then uses the number from this line to increase max player's health, but for some reason i can't get this number. Can someone help me? Here's the code:
Code:
on armor equip:
    wait a tick
    if {health.%player%} is not set:
        set {health.%player%} to player's max health
    set {_item} to player's helmet
    set {_l} to "%lore of {_item}%"
    set {_lore::*} to {_l} split at ","
    set {_counter} to 1
    loop {_lore::*}:
        set {_2} to loop-value
        if {_2} contains "&7Health&f&l:":
            set {_gethealth::*} to uncolored loop-value parsed as "&7Health&f&l: &a%num%&f&l"
        send "%{_lore::%{_counter}%}%" to player
        send "%{_gethealth::1}%" to player
        add 1 to {_counter}
    add {_gethealth::1} to {health.%player%}
    send "Health is increased on %{_gethealth::1}%." to player
Variable {_gethealth::1} returns <none> every time, don't know how to fix this.
 
Status
Not open for further replies.