Solved İf Max 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!

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

Yaşarhan

Active Member
May 16, 2020
87
6
8
23
Turkey Istanbul
Welcome, thanks.
I have a little problem.

Code:
on right click on anvil:
    cancel event
    if durability of player's tool is max durability of player's tool:
        broadcast "Max Durability"
    else:
        broadcast "Damaged Durability"

For damaged and undamaged tools: "Damaged Durability" I get the result.
 
Last edited:
Code:
on right click on anvil:
    cancel event
    set {_durability} to max durability of player's tool - durability of player's tool
    if {_durability} is max durability of player's tool:
        broadcast "Max Durability"
    else:
        broadcast "Damaged Durability"
 
  • Like
Reactions: Yaşarhan
Code:
on right click on anvil:
    cancel event
    set {_durability} to max durability of player's tool - durability of player's tool
    if {_durability} is max durability of player's tool:
        broadcast "Max Durability"
    else:
        broadcast "Damaged Durability"

I guess the script couldn't directly check if the durability level of an item is maximum or not, thank you.
 
Status
Not open for further replies.