# :===:===:===:===:===:===:===:===:===: # Nazwa: damix-targ # Autor: damixedixed # Opis: # -poprawiony kod # To Do: # -dokonczyc skrypt (xd) # Wersja: 0.3.8 # :===:===:===:===:===:===:===:===:===: on load: if folder "plugins/damix-targ" doesn't exists: create folder "plugins/damix-targ" create folder "plugins/damix-targ/targi" create file "plugins/damix-targ/config.yml" create file "plugins/damix-targ/messages.yml" download "https://code.skript.pl/FCYEyjxS/raw" to "plugins/damix-targ/messages.yml" download "https://code.skript.pl/0DThLoTb/raw" to "plugina/damix-targ/config.yml" wait 5 seconds broadcast "&6damixedixed-skripts &3reload skryptu na targi" execute console command "sk reload %script%" else: set {gui.name} to single value "gui_name" get of "plugins/damix-targ/config.yml" set {tag.targ} to single value "tag" get of "plugins/damix-targ/config.yml" command /targ []: executable by: players trigger: wait 1 tick open chest with 5 rows named "%{gui.name}%" to player wait 2 ticks loop 44 times: set {_targ} to 0 loop all players: if loop-player is "MistrzPiter77" or "PLXDTR" or "damixedixed": format slot {_targ} of player with 1 of redstone block named "&4&l&n%loop-player%" with lore " " to close then run [execute player command "sprawdz %loop-player%"] else if loop-player has permissions "damixedixed.scripts.vip.targ": format slot {_targ} of player with 1 of ender chest named "&6&l%loop-player%" with lore " " to close then run [execute player command "sprawdz %loop-player%"] else: format slot {_targ} of player with 1 of chest named "&7%loop-player%" with lore " " to close then run [execute player command "sprawdz %loop-player%"] add 1 to {_targ} command /wystaw : executable by: players usage: /wystaw trigger: if player's tool is air: set {air.item} to single value "air_item" get of "plugins/damix-targ/messages.yml" send "%{tag.targ}% %{air.item}%" else: set {nowy.item.%player%} to player's tool if file "plugins/damix-targ/targi/%player%.yml" doesn't exists: create file "plugins/damix-targ/targi/%player%.yml" download "https://code.skript.pl/zTQ3CrS5/raw" to "plugins/damix-targ/targi/%player%.yml" set {item} to "%player's tool%" set {item.cena} to arg set {_abc} to 0 loop 9 times: set {i.%{_abc}%} to configuration section "item.%{_abc}%/przedmiot" get of "plugins/damix-targ/targi/%player%.yml" add 1 to {_abc} set {_ac} to 0 loop 9 times: if {i.%{_ac}%} is "0": set "item.%{_ac}%/przedmiot" to "%player's tool%" in yaml file "plugins/damix-targ/targi/%player%.yml" set "item.%{_ac}%/cena" to "%arg%" in yaml file "plugins/damix-targ/targi/%player%.yml" remove player's tool from player's inventory set {succes.out} to single value "succesful_put_out" get of "plugins/damix-targ/targi/%player%.yml" send "%{tag.targ}% %{succes.out}%" stop set {max.out} to single value "max_out" get of "plugins/damix-targ/messages.yml" send "%{tag.targ}% %{max.out}%" command /sprawdz : executable by: players trigger: set {_i} to 0 wait 2 ticks open chest with 2 rows named "&b%arg%" to player wait 2 tick loop 9 times: set {_x} to confoguration section "item.%{_i}%/cena" get of "plugins/damix-targ/targi/%arg%.yml" if {_x} is bigger than 0: set {itemek.%{_i}%} to configuration section "item.%{_i}%/przedmiot" get of "plugins/damix-targ/targi/%arg%.yml" set {cena.%{_i}%} to configuration section "item.%{_i}%/cena" get of "plugins/damix-targ/targi/%arg%.yml" format slot {_i} of player with 1 of {itemek.%{_i}%} to close then run [execute console command "kupuje-item %{_i}% %arg% %player%"] add 1 to {_i}