on skript load: if file "plugins/ATM" doesn't exist: create file "plugins/ATM" on join: if file "plugins/ATM/%player%.yml" doesn't exist: create file "plugins/ATM/%player%" function openGui(gracz: player): open chest with 1 rows named "» Bankomat" to {_gracz} wait 2 tick if "%inventory name of current inventory of {_gracz}%" contains "»": if {account::stan::%player%} is false: format slot 1 of {_gracz} with 1 of green wool named "&8» &aStwórz konto bankowe" to close then run "atm {_gracz} create" if {account::stan::%player%} is true: format slot 1 of {_gracz} with 1 of nether wart named "&8» &6Wpłac: &a10,000$" to close then run "atm {_gracz} wplac 10000" format slot 2 of {_gracz} with 1 of diamond named "&8» &6Wpłać: &a5,000$" to close then run "atm {_gracz} wplac 5000" format slot 3 of {_gracz} with 1 of iron ingot named "&8» &6Wpłać: &a1,000$" to close then run "atm {_gracz} wplac 1000" format slot 4 of {_gracz} with 1 of gold ingot named "&8» &6Wpłać: &a500$" to close then run "atm {_gracz} wplac 500" format slot 5 of {_gracz} with 1 of gun powder named "&8» &6Wpłać: &a100$" to close then run "atm {_gracz} wplac 100" format slot 6 of {_gracz} with 1 of gold nugget named "&8» &6Stan konta: &b%{konto::stan::%player%}%" to be unstealable format slot 7 of {_gracz} with 1 of gun powder named "&8» &6Wypłać: &4100$" to close then run "atm {_gracz} wyplac 100" format slot 8 of {_gracz} with 1 of gold ingot named "&8» &6Wypłać: &4500$" to close then run "atm {_gracz} wyplac 500" format slot 9 of {_gracz} with 1 of iron ingot named "&8» &6Wypłać: &41,000$" to close then run "atm {_gracz} wyplac 1000" format slot 10 of {_gracz} with 1 of diamond named "&8» &6Wypłać: &45,000$" to close then run "atm {_gracz} wyplac 5000" format slot 11 of {_gracz} with 1 of nether wart named "&8» &6Wypłać: &410,000$" to close then run "atm {_gracz} wyplac 10000" format slot 12 of {_gracz} with 1 of barrier named "&8» &4Wyjdz" to close format slot 13 of {_gracz} with 1 of iron ingot named "&8» &6Wyrób karte" to close then run "atm {_gracz} wyrob" function cardGui(gracz: player, f: text): if player has permission "karta.use": open chest with 1 rows named "» Karta" to {_gracz} wait 2 tick if "%inventory name of current inventory of {_gracz}%" contains "»": if {account::stan::%player%} is false: format slot 1 of {_gracz} with 1 of green wool named "&8» &aStwórz konto bankowe" to close then run "atm {_gracz} create" if {account::stan::%player%} is true: if {_f} is "%{transakcja::%player%}%": set {konto::stan::%player-arg%} to yaml value "%player-arg%.bank.balance" from file "plugins/ATM/%player-arg%.yml" format slot 1 of {_gracz} with 1 of gren wool named "&8» &aPotwierdz transakcje" to close then run "atm {_gracz} potwie" format slot 2 of {_gracz} with 1 of red wool named "&8» &4Odrzuć transakcje" to close then run "atm {_gracz} odrzuc" format slot 3 of {_gracz} with 1 of gold nugget named "&8» &6Stan konta: &b%{konto::stan::%player%}%" to be unstealable format slot 4 of {_gracz} with 1 of iron nugget named "&8» &6Do zapłaty: %{tra::k}%" to be unstealable command /atm [] [] []: executable by: console trigger: if arg 2 is "create": if {account::stan::%player-arg%} is true: cancel event if {account::stan::%player-arg%} is false: set {account::stan::%player-arg%} to true openGui(player-arg) if arg 2 is "wplac": set {konto::stan::%player-arg%} to yaml value "%player-arg%.bank.balance" from file "plugins/ATM/%player-arg%.yml" if player-arg's money is greater or equal to arg 3: remove arg 3 from player-arg's balance set yaml value "%player-arg%.bank.balance" from file "plugins/ATM/%player-arg%.yml" to {konto::stan::%player-arg%} + arg 3 openGui(player-arg) else: cancel event if arg 2 is "wyplac": set {konto::stan::%player-arg%} to yaml value "%player-arg%.bank.balance" from file "plugins/ATM/%player-arg%.yml" if {konto::stan::%player-arg%} is greater or equal to arg 3: set yaml value "%player-arg%.bank.balance" from file "plugins/ATM/%player-arg%.yml" to {konto::stan::%player-arg%} - arg 3 add arg 3 to player-arg's balance openGui(player-arg) if arg 2 is "potwie": set {konto::stan::%player-arg%} to yaml value "%player-arg%.bank.balance" from file "plugins/ATM/%player-arg%.yml" if {konto::stan::%player-arg%} is greater or equal to {tra::k}: set yaml value "%player-arg%.bank.balance" from file "plugins/ATM/%player-arg%.yml" to {konto::stan::%player-arg%} - {tra::k} add {tra::k} to {tra::x} balance send "&8» &6Gracz %player-arg% zapłacił za transakcje!" to {tra::x} else: cancel event if arg 2 is "odrzuc": send "&8» &6Gracz %player-arg% odrzucił transakcje." to {tra::x} if arg 2 is "wyrob": execute console command "pex user %player-arg% add karta.use" command /transakcja [] []: aliases: tra trigger: if player has permission "transakcja.give": if arg 1 is not set: send "&8» &cPoprawne wykonanie: &b/transakcja " to player if arg 1 is set: if arg 2 is set: cardGui(player-arg) send "&8» &6Wysłałeś transakcję o cenie |%arg 2%|, do gracza |%player-arg%|." set {tra::x} to %player% set {tra::k} to %arg 2% on right click on sign: if line 1 is "&8---": if line 2 is "&2ATM": if line 3 is " ": if line 4 is "&8---": openGui(player)