Health increases to infinity.

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

fureds

Member
Aug 25, 2024
1
0
1
If you release your armor and wear it during a script experiment, your physical strength will increase indefinitely.
What the hell's wrong with him?

I think the code in question is this :
on armor equip:
if 3rd line of lore of event-item contains "체력":
set {_lore} to 3rd line of lore of event-item
replace all "&a체력 + " with "" in {_lore}
set {_hel} to {_lore} parsed as number
add {_hel} to player's max health
on armor unequip:
if 3rd line of lore of event-item contains "체력":
set {_lore} to 3rd line of lore of event-item
replace all "&a체력 + " with "" in {_lore}
set {_hel} to {_lore} parsed as number
remove {_hel} from player's max health
 

Attachments

  • starforce.sk
    146.4 KB · Views: 169
I’m not entirely sure if I understood correctly, but if you’re trying to make health or any effect increase or decrease based on armor,
the best approach might be something like this.
(It doesn’t necessarily need to be a loop event.)


C-like:
every second:
    loop all players:
        set {basehealth.%loop-player%} to 10 # Set the Base Health to 10 hearts
        set {updatehealth.%loop-player%} to {basehealth.%loop-player%}
       
        # Check for custom armor pieces and adjust health
        if loop-player's helmet is leather helmet named "&6Health Helm":
            add 5 to {updatehealth.%loop-player%} # Add 2.5 hearts (5 HP) for the helmet
        if loop-player's chestplate is leather chestplate named "&6Health Chestplate":
            add 10 to {updatehealth.%loop-player%} # Add 5 hearts (10 HP) for the chestplate
        if loop-player's leggings are leather leggings named "&6Health Leggings":
            add 7 to {updatehealth.%loop-player%} # Add 3.5 hearts (7 HP) for the leggings
        if loop-player's boots are leather boots named "&6Health Boots":
            add 3 to {updatehealth.%loop-player%} # Add 1.5 hearts (3 HP) for the boots
        # Update player's health if it differs from the calculated one
        if {health.%loop-player%} is not equal to {updatehealth.%loop-player%}:
            set {health.%loop-player%} to {updatehealth.%loop-player%}
            set loop-player's max health to {health.%loop-player%}
            set loop-player's health to min({health.%loop-player%}, loop-player's max health)



I hope this helps!