Hello, im making a custom enchantment, and seem to be stuck with it. Im not 100% sure what is wrong and why its only adding 1 lvl to the enchantment. I need it to stop and 5 and no more, but when i apply the enchant, it stops at 1. I updated skript from a older version and im not sure if there were big changes or not? But i get no errors with the code. It just wont add 1 lvl after i apply it.
Skript version: 2.4
server version: 1.14.4
CODE:
Thanks!
~Matt
Skript version: 2.4
server version: 1.14.4
CODE:
Code:
options:
enchantments: Fortune|Efficiency|Explosive|Earthquake|Night Vision|Repair|Mining Crate|fulminis|Rings|Enlighted|Hardened|Poisoned|Frozen|Revulsion|Cursed|Gooey|Deathbringer|Thundering Blow|Vampire|Blind|Jump|Speed
function pickdrill(P: player):
if lore of {_P}'s held item doesn't contain colored "&bDrill 5":
if {rings::%{_P}%} is more than or equal to 100:
remove 100 from {rings::%{_P}%}
set {_l::*} to lore of {_P}'s tool
set {_enc} to "&bDrill"
add 1 to {_enchantments::total}
set {_total} to 1
loop {_l::*}:
delete {_l2::*}
set {_l2::*} to uncolored loop-value parsed as "%text% %integer%"
{_l2::*} is set
add {_l2::2} to {_total}
if {_l2::1} is uncolored {_enc}:
if {_l2::2} >= 5:
send "&c(&4!&c) &7Sorry, but you are at the max level." to {_P}
stop
set {_b} to true
add 1 to {_l2::2}
set {_l::%loop-index%} to "&e%{_enc}% %{_l2::2}%"
set {_level::%{_l2::1}%} to {_l2::2}
send "Total: %{_total}%" to {_P}
set {_l::*} to lore of {_P}'s tool
set line 1 of lore of {_P}'s held item to "&a&m===&f %{_total}% &aEnchantments &a&m==="
if {_b} is not set:
wait 1 ticks
set line 2 of lore of {_P}'s held item to "&9&nPickaxe Information"
wait 1 ticks
add "&e%{_enc}% 1" to lore of {_P}'s tool
set {_enc::*} to split "{@enchantments}" at "|"
loop {_enc::*}:
set {_lvl2::%loop-index%} to {_level::%loop-value%} ? 0
else:
send "&c(&4!&c) &7Sorry, but you don't have rings!" to {_P}
else:
send "&c(&4!&c) &7Sorry, but you are at the max level!" to {_P}
Thanks!
~Matt