Hi everyone,
i have a problem. I'm creating skript for kits, like essentials kits. My problem is how i can parse item with name? Look:
Here is parsing code:
0 erros. First, i load item to {kity::%{_kit}%::gui::item} (in yml file: item: stone pickaxe named "&6» &7Zestaw Startowy &6«"). I parse this to item, but it's return <none>. Do you understand?
When i load this kit to gui:
Gui is empty, becouse {kity::%{_kit}%::gui::item} is not a itemtype. When i type in config id or name of item inself, all works correctly. The problem arises when I want to name this item.
Thanks for help and happy New Year
i have a problem. I'm creating skript for kits, like essentials kits. My problem is how i can parse item with name? Look:
code_language.skript:
function reloadKit(kit: text):
set {kity::%{_kit}%::id} to yml value "kity.%{_kit}%.id" from file "plugins/Skript/scripts/kity/config.yml"
set {kity::%{_kit}%::id} to parseInt("%{kity::%{_kit}%::id}%")
set {kity::%{_kit}%::delay} to yml value "kity.%{_kit}%.delay" from file "plugins/Skript/scripts/kity/config.yml"
set {kity::%{_kit}%::delay} to parseInt("%{kity::%{_kit}%::delay}%")
set {kity::%{_kit}%::gui::item} to yml value "kity.%{_kit}%.gui.item" from file "plugins/Skript/scripts/kity/config.yml"
set {kity::%{_kit}%::gui::item} to parseItem("%{kity::%{_kit}%::gui::item}%")
set {kity::%{_kit}%::gui::slot} to yml value "kity.%{_kit}%.gui.slot" from file "plugins/Skript/scripts/kity/config.yml"
set {kity::%{_kit}%::gui::slot} to parseInt("%{kity::%{_kit}%::gui::slot}%") - 1
set {kity::%{_kit}%::items::*} to yml list "kity.%{_kit}%.items" from file "plugins/Skript/scripts/kity/config.yml"
send "&f[&a&nKity&f] Zaladowano zestaw &a%{_kit}% &f(&a##%{kity::%{_kit}%::id}%&f)." to console
Here is parsing code:
code_language.skript:
function parseInt(int: text) :: number:
set {_x} to {_int} parsed as number
return {_x}
function parseItem(item: text) :: item:
set {_x} to {_item} parsed as itemtype
if parse error is set:
broadcast "%parse error%"
return {_x}
0 erros. First, i load item to {kity::%{_kit}%::gui::item} (in yml file: item: stone pickaxe named "&6» &7Zestaw Startowy &6«"). I parse this to item, but it's return <none>. Do you understand?
When i load this kit to gui:
code_language.skript:
command /kit [<text>]:
aliases: zestaw
executable by: players
trigger:
set {_p} to player
open chest with 1 row named "&6» &cDostepne zestawy &6«" to {_p}
wait 2 tick
if inventory name of {_p}'s current inventory is "&6» &cDostepne zestawy &6«":
loop {kity::kits::*}:
set {_kit} to loop-value
format slot {kity::%{_kit}%::gui::slot} of {_p} with {kity::%{_kit}%::gui::item} to be unstealable
Gui is empty, becouse {kity::%{_kit}%::gui::item} is not a itemtype. When i type in config id or name of item inself, all works correctly. The problem arises when I want to name this item.
Thanks for help and happy New Year