Solved Lore durability

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

CringeBoy

Active Member
May 20, 2021
65
0
6
Romania
Can someone help me with a lore durability system? As example an iron axe that has durability 200. Show 200/200 and for every block broken to remove 1 durability 199/200
[doublepost=1623317669,1623317616][/doublepost]And also break it when the durability is 0/200
 
Code:
#durability is in line 1 and it looks like
# &cLEFT&8/&aMAX

command /setdura <integer>:
    trigger:
        set line 1 of lore of player's tool to "&c%arg-1%&8/&a%arg-1%"

on block break:
    if tool of player is a pickaxe or shovel or axe:
        set {_lore::*} to uncolored line 1 of lore of player's tool split at "/"
        set {_left} to {_lore::1} parsed as a integer
        if {_left} is 0:
            set tool of player to air
        else:
            set line 1 of lore of player's tool to "&c%{_left} - 1%&8/&a%{_lore::2}%"
        wait 1 tick
        repair tool of player