# :===:===:===:===:===:===:===:===:===: # Nazwa: damix-targ # Autor: damixedixed # Opis: # -dokonczony skrypt # To Do: # -naprawic blady jesli takowe wystapia # Wersja: 0.6.3 # :===:===:===:===:===:===:===:===:===: 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 "&bItemy Gracza" to player wait 2 tick loop 9 times: set {_x} to configuration section "item.%{_i}%/cena" get of "plugins/damix-targ/targi/%arg%.yml" if {_x} is bigger than 0: set {inventory.%player%} to "%arg%" 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" set slot {_i} of player's current inventory to {itemek.%{_i}%} add 1 to {_i} on inventory click: if inventory name of player's current inventory is "&bItemy Gracza": cancel event set {_s} to 0 loop 9 times: if clicked slot is {_s}: execute console command "kupuje %{_s}% %{inventory.%player%}% %player%" command /kupuje : executable by: console trigger: set {_haha} to 0 loop 9 times: if arg 1 is {_haha}: set {_cena} to configuration section "item.%{_haha}%/cena" get of "plugins/damix-targ/targi/%arg 2%.yml" if {monety::%arg 3%} is biger than {_cena} or {_cena}: remove {_cena} from {monety::%arg 3%} set {it.%arg 3%} to configuration section "item.%{_haha}%/przedmiot" get of "plugins/damix-targ/targi/%arg 2%.yml" give {it.%arg 3%} to arg 3 set "item.%{_haha}%/przedmiot" to "0" in yaml file "plugins/damix-targ/targi/%arg 2%.yml" set "item.%{_haha}%/cena" to "0" in yaml file "plugins/damix-targ/targi/%arg 2%.yml" send "%{tag.targ}% &aSuccesfull trade!" else: send "%{tag.targ}% &cYou don't have required money!"