Hi,
I'm trying to make checks for enchantments/lores. I have this code and I need to check if the lore ({_ttench}) is already in the lore, I tried to loop, but it only checks the first line of the items lore. Does anyone know how to do that?
I'm trying to make checks for enchantments/lores. I have this code and I need to check if the lore ({_ttench}) is already in the lore, I tried to loop, but it only checks the first line of the items lore. Does anyone know how to do that?
code_language.skript:
function enchantTierII(p: player):
if name of {_p}'s held item contains "Tier I Sword":
set {_ttench} to a random element out of {swordench::*}
set {_ttier} to a random integer between 1 and 3
if {_ttier} = 1:
set {_roman} to "I"
if {_ttier} = 2:
set {_roman} to "II"
if {_ttier} = 3:
set {_roman} to "III"
loop lore of {_p}'s tool:
if loop-value contains "%{_ttench}%":
set {_ttench} to a random element out of {swordench::*}
else:
set {_tfinal} to "%{_ttench}% %{_roman}%"
set name of {_p}'s tool to "&cTier II Sword"
addLoreSword({_p}, {_tfinal}, {_tfinal})
msgEnch({_p}, "Tier II Sword", {_ttench})
send "%loop-value%" to {_p}
stop loop