Replace held item properly

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

ItsAssasin

New Member
Jul 22, 2021
6
0
1
23
Hi, im making a hypixel skyblock Atomsplit Katana recreation, well, when you right click with that diamond sword, it changes to a golden sword for 4 seconds and then changes again to diamond. Ive managed to make the diamond sword change and change back, but if i change the weapon slot, the golden sword stays as golden and the diamond sword appears in the slot that you initially right clicked, making the sword dupe. Here is my code:

Code:
on right click:
   if player's held item is diamond sword named "&6Atomsplit Katana":
       set {_nbt} to nbt of player's held item
       set player's held item to golden sword with nbt "%{_nbt}%"
       wait 4 seconds
       set player's held item to diamond sword with nbt "%{_nbt}%"

Any help is welcome :emoji_slight_smile:
 
Status
Not open for further replies.