"on item damage" how to cancel item damage?

  • 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.
Mar 29, 2020
28
0
1
29
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:
on item damage:
    if item is a stone sword:
        chance of 50%:
            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:
on item damage:
    chance of 50%:
        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
 
Status
Not open for further replies.