Solved Item breaks after being used (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!

2nq_

Member
Feb 11, 2024
3
0
1
34
So what happens, is that I get that item, and I'm supposed to poison someone. When I use it for the 1st time, it works. Once I use it and the durability goes down, it stops poisoning people. So how do I make it unbreakable / usable after getting it's durability down?

Here's my code:
Code:
on load:
  set {mieczzatrucia} to diamond sword with custom model data 1 named "&x&2&5&6&C&0&3&lZ&x&2&A&7&3&0&7&la&x&2&F&7&9&0&B&lt&x&3&3&8&0&0&F&lr&x&3&8&8&6&1&3&lu&x&3&D&8&D&1&7&lt&x&4&2&9&3&1&B&le &x&4&6&9&A&1&E&lO&x&4&B&A&0&2&2&ls&x&5&0&A&7&2&6&lt&x&5&5&A&D&2&A&lr&x&5&9&B&4&2&E&lz&x&5&E&B&A&3&2&le" with lore "&7" and " &2» &aPo uderzeniu masz 50%%" and " &2» &ana otrucie przeciwnika"


options:
    admingui: &2Przedmioty admina
    permisja: jakub-core-admin
    brak-permisji: &2Nie posiadasz permisji &ajakub-core-admin
command /items:
    permission: {@permisja}
    permission message: {@brak-permisji}
    aliases: itemyadmina,adminitems,ai
    trigger:
        set {_admingui} to a new chest inventory with 2 rows with name "{@admingui}"
        open {_admingui} to player
        set slot 0 of {_admingui} to {mieczzatrucia}


on damage:
  if attacker's tool is {mieczzatrucia}:
    chance of 50%:
      apply poison to victim for 15 seconds
      
      send actionbar "&aOtrułeś przeciwnika" to attacker
      send title "&aZOSTAŁEŚ OTRUTY" to victim for 1 seconds with fadein 1 second and fade out 1 second
      play sound "ENTITY_WITCH_HURT" with pitch 1 to victim
 
set {mieczzatrucia} to unbreakable diamond sword with custom model data 1 named
also join discord