I am trying to make items that give special effects when in your main hand. When the durability goes down, the skript stops working, as it thinks that the only thing it can do is... give it if the the sword/item has full durability. Is there any way to solve this? I have tried to make it so it repairs the item but when I try "repair player's held item" there are no errors but it doesn't work.
EDIT:
I forgot to put the code lmao:
EDIT:
I forgot to put the code lmao:
Code:
command /customitems:
permission: customitems.gui.show
trigger:
open virtual chest with size 3 named "&9&lCustom Items" to player
wait 1 tick
format gui slot 0,1,2,3,4,5,6,7,8,9,17,18,19,21,22,23,24,25, and 26 of player with purple stained glass pane named " " to do nothing
format gui slot 10 of player with stone sword named "&8Wither Sword" with lore "&cUsed To Give Wither" to run:
give player a stone sword named "&8Wither Sword" with lore "&7(Gives Wither For 4 Seconds)"
format gui slot 12 of player with mushroom soup named "&dHearty Soup" with lore "&aUsed To Give Health!" to run:
give player a mushroom soup named "&dHearty Soup" with lore "&7(Gives Regeneration For 10 Seconds)"
format gui slot 14 of player with gold sword named "&8Weakness Sword" with lore "&cUsed To Give Weakness" to run:
give player a gold sword named "&8Weakness Sword" with lore "&7(Gives Weakness For 4 Seconds)"
format gui slot 16 of player with wooden sword named "&9Health Sword" with lore "&aUsed To Give Hearts" to run:
give player a wooden sword named "&9Health Sword" with lore "&7(Gives Health Boost)"
format gui slot 20 of player with diamond sword named "&6Speed Sword" with lore "&aUsed To Give Speed" to run:
give player a diamond sword named "&6Speed Sword" with lore "&7(Gives Speed Boost)"
on damage:
if victim is a player:
if attacker is a player:
if attacker's tool is a stone sword named "&8Wither Sword" with lore "&7(Gives Wither For 4 Seconds)":
apply wither 2 to victim for 4 seconds
repair attacker's tool by 1000
on rightclick:
if player's tool is mushroom soup:
if name of player's tool is "&dHearty Soup":
apply regeneration 2 to player for 10 seconds
remove 1 of player's held item from player's inventory
every 2 seconds in world "world":
loop all players:
if loop-player's held item is a wooden sword named "&9Health Sword" with lore "&7(Gives Health Boost)":
apply health boost 2 to loop-player for 4 seconds
wait 12 seconds
remove health boost from loop-player
if loop-player's held item is a diamond sword named "&6Speed Sword" with lore "&7(Gives Speed Boost)":
apply speed 2 to loop-player for 4 seconds
wait 60 seconds
remove speed from loop-player
on damage:
victim is a player
attacker is a player
if attacker's held item is a gold sword named "&8Weakness Sword":
apply weakness to victim for 5 seconds
on damage:
if attacker is a player:
if attacker's held item is a diamond sword named "&6Speed Sword":
repair player's held item