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.

"on item damage" how to cancel item damage?

Discussion in 'Skript' started by nicolas toledo, Apr 25, 2021.

Thread Status:
Not open for further replies.
  1. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    28
    Likes Received:
    0
    Hi guys, I'm doing a MMORPG server and since I can't find plugins to change the durability of the items, it seemed like a good idea to make certain items have "chance%" to cancel the damage event of the event-item so that the items last longer Here is an example of what I want to do.
    Code (Text):
    1. on item damage:
    2.     if item is a stone sword:
    3.         chance of 50%:
    4.             cancel event
    The code does not give errors, but it does not fulfill the function that I want !.

    Only this way it works but cancels the damage of all items, not just the specific item:

    Code (Text):
    1. on item damage:
    2.     chance of 50%:
    3.         cancel event
    So .. how do I detect item damage for a specific item? Or is there some other way to change the durability of the items? Thank you
     
  2. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    Try
    Code (Text):
    1. if item is stone sword:
    2. # or
    3. if event-item is stone sword:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...