Witam, mam problem z moją komendą /enchant ktora automatycznie dodaje lore po nadaniu enchantu, lecz jest taki problem ze dodaje wszystkie lore kazdego enchantu zamiast tylko wybranego.
options:
f: "plugins/Skript/Skrypty/Enchant/config.yml"
on load:
set {enchant::number-of-enchants} to yaml value "number-of-enchants" from file {@f}
loop {enchant::number-of-enchants} parsed as number times:
set {enchant::enchants::%loop-number%::enchant} to yaml value "enchants.%loop-number%.enchant" from file {@f}
set {enchant::enchants::%loop-number%::lore-name} to yaml value "enchants.%loop-number%.lore-name" from file {@f}
command /enchant [<text>] [<number>]:
aliases: boxpvp-core:enchant
trigger:
if player has permission "boxpvp.command.enchant":
if arg 1 is set:
if arg 2 is set:
loop {enchant::number-of-enchants} parsed as number times:
execute player command "ie enchant %arg-1% %arg-2%"
execute player command "ie lore add %{enchant::enchants::%loop-number%::lore-name}% %arg-2%"
#execute player command "ie hideall"
exit 1 loop
on tab complete of "/enchant" and "/boxpvp-core:enchant":
loop {enchant::number-of-enchants} parsed as number times:
add "%{enchant::enchants::%loop-number%::enchant}%" to tab completions of position 1
if tab arg-1 is set:
set tab completions of position 2 to "<moc>"
Jesli mozna, to fajnie jakby ktos mogl dodac zeby automatycznie usuwalo lore jak usunie sie enchant (opcjonalne)
Pytanie
AlanKK 0
Witam, mam problem z moją komendą /enchant ktora automatycznie dodaje lore po nadaniu enchantu, lecz jest taki problem ze dodaje wszystkie lore kazdego enchantu zamiast tylko wybranego.
config.yml
number-of-enchants: '6' # Liczba wszystkich enchantów enchants: 1: enchant: 'EFFICIENCY' lore-name: '&x&A&C&8&2&1&5[⛏] &x&F&6&C&A&2&DWydajność: ' 2: enchant: 'FIRE_ASPECT' lore-name: '&x&9&A&4&2&A&2[
] &x&D&8&6&1&F&6Zaklęty Ogień: '
3:
enchant: 'UNBREAKING'
lore-name: '&x&1&6&A&5&2&D[
] &x&0&0&F&F&1&ANiezniszczalność: '
4:
enchant: 'SHARPNESS'
lore-name: '&x&B&C&4&4&4&4[🗡] &x&F&F&6&1&4&BOstrość: '
5:
enchant: 'FORTUNE'
lore-name: '&x&C&1&6&0&2&9[✤] &x&F&F&7&F&3&7Szczęście: '
6:
enchant: 'PROTECTION'
lore-name: '&x&3&E&7&6&C&B[🛡] &x&3&9&C&4&F&FOchrona: '
skrypt
options: f: "plugins/Skript/Skrypty/Enchant/config.yml" on load: set {enchant::number-of-enchants} to yaml value "number-of-enchants" from file {@f} loop {enchant::number-of-enchants} parsed as number times: set {enchant::enchants::%loop-number%::enchant} to yaml value "enchants.%loop-number%.enchant" from file {@f} set {enchant::enchants::%loop-number%::lore-name} to yaml value "enchants.%loop-number%.lore-name" from file {@f} command /enchant [<text>] [<number>]: aliases: boxpvp-core:enchant trigger: if player has permission "boxpvp.command.enchant": if arg 1 is set: if arg 2 is set: loop {enchant::number-of-enchants} parsed as number times: execute player command "ie enchant %arg-1% %arg-2%" execute player command "ie lore add %{enchant::enchants::%loop-number%::lore-name}% %arg-2%" #execute player command "ie hideall" exit 1 loop on tab complete of "/enchant" and "/boxpvp-core:enchant": loop {enchant::number-of-enchants} parsed as number times: add "%{enchant::enchants::%loop-number%::enchant}%" to tab completions of position 1 if tab arg-1 is set: set tab completions of position 2 to "<moc>"Jesli mozna, to fajnie jakby ktos mogl dodac zeby automatycznie usuwalo lore jak usunie sie enchant (opcjonalne)
Pozdrawiam
Odnośnik do komentarza
https://skript.pl/temat/56293-problem-z-lore-enchant/Udostępnij na innych stronach
2 odpowiedzi na to pytanie
Rekomendowane odpowiedzi