function borderNull(): set yaml value "border.start" from "lpborder" to 1000 set yaml value "border.max" from "lpborder" to 10000 set yaml value "border.lvl" from "lpborder" to 1 set yaml value "border.lvlup" from "lpborder" to 100 set yaml value "border.item" from "lpborder" to "16 diamond" set yaml value "border.time" from "lpborder" to 120 save yaml "lpborder" function borderVarSet(): unload yaml "lpborder" load yaml "plugins/SK-LPBorder/config.yml" as "lpborder" set {lpborder.start} to yaml value "border.start" from "lpborder" set {lpborder.max} to yaml value "border.max" from "lpborder" set {lpborder.lvlup} to yaml value "border.lvlup" from "lpborder" set {lpborder.lvl} to yaml value "border.lvl" from "lpborder" set {lpborder.item} to yaml value "border.item" from "lpborder" parsed as item set {lpborder.time} to yaml value "border.time" from "lpborder" function borderVarUnset(): delete {lpborder.start} delete {lpborder.max} delete {lpborder.lvlup} delete {lpborder.lvl} delete {lpborder.item} delete {lpborder.time} function borderSetSize(): set {_size} to {lpborder.start} + (({lpborder.lvl}-1)*{lpborder.lvlup}) execute console command "worldborder set %{_size}% %{lpborder.time}%" function borderAdd(p: player): if {_p} has {lpborder.item}: set {_s} to {lpborder.start} + (({lpborder.lvl}-1)*{lpborder.lvlup}) if {_s} < {lpborder.max}: remove {lpborder.item} from {_p}'s inventory set yaml value "border.lvl" from "lpborder" to {lpborder.lvl}+1 save yaml "lpborder" borderVarSet() borderSetSize() send title "&aBorder +" with subtitle "&9Border rosnie" to {_p} for 5 seconds else: send title "&cUPSSS" with subtitle "&9Border osiagnal swoj limit" to {_p} for 5 seconds else: send title "&cUPSSS" with subtitle "&4Nie masz surowcow na ulepszenie" to {_p} for 5 seconds function borderGUI(p: player): set {_s} to {lpborder.start} + (({lpborder.lvl}-1)*{lpborder.lvlup}) set {_d} to (({lpborder.lvl}-1)*{lpborder.lvlup}) open virtual chest with 1 rows named "&8&lB&7&lorder &3Menu" to {_p} format gui slot 3 of {_p} with map named "&aPowieksz &8&lB&7order &6[&a+1&6]" with lore "&8Koszt: &b%{lpborder.item}%" to close then run function borderAdd({_p}) format gui slot 5 of {_p} with book named "&2&lB&7order&8:" with lore "&eWielkosc&8: &7%{_s}%&8/&7%{lpborder.max}%" and "&ePoziom&8 &7%{lpborder.lvl}%" and "&ePowiekszenie&8: %{_d}%" on load: load yaml "plugins/SK-LPBorder/config.yml" as "lpborder" set {_yml} to yaml value "border.start" from "lpborder" if {_yml} is not set: borderNull() borderVarSet() borderSetSize() else: borderVarSet() borderSetSize() on unload: borderVarUnset() unload yaml "lpborder" command /lpborder []: permission: lpborder.cmd trigger: if arg-1 is "reload": if player has permission "lpborder.reload": borderVarSet() send " &6L&9P&7Border &8- &aprzeladowano zmienne" else: send " &6L&9P&7Border &cbrak uprawnien" else: borderGUI(player) on rightclick on book shelf holding a book: borderGUI(player)