1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved İf Max Durability

Discussion in 'Skript' started by Yaşarhan, Oct 25, 2020.

  1. Yaşarhan

    Yaşarhan Active Member

    Joined:
    May 16, 2020
    Messages:
    74
    Likes Received:
    6
    Welcome, thanks.
    I have a little problem.

    Code (Text):
    1. on right click on anvil:
    2.     cancel event
    3.     if durability of player's tool is max durability of player's tool:
    4.         broadcast "Max Durability"
    5.     else:
    6.         broadcast "Damaged Durability"
    For damaged and undamaged tools: "Damaged Durability" I get the result.
     
    #1 Yaşarhan, Oct 25, 2020
    Last edited: Oct 25, 2020
  2. Best Answer:
    Post #2 by Time4Games, Oct 26, 2020
  3. Time4Games

    Time4Games Active Member

    Joined:
    Jul 25, 2020
    Messages:
    147
    Likes Received:
    4
    Code (Text):
    1. on right click on anvil:
    2.     cancel event
    3.     set {_durability} to max durability of player's tool - durability of player's tool
    4.     if {_durability} is max durability of player's tool:
    5.         broadcast "Max Durability"
    6.     else:
    7.         broadcast "Damaged Durability"
     
    • Like Like x 1
  4. Yaşarhan

    Yaşarhan Active Member

    Joined:
    May 16, 2020
    Messages:
    74
    Likes Received:
    6
    I guess the script couldn't directly check if the durability level of an item is maximum or not, thank you.
     
Loading...