on load: if yaml value "correctusage" from file "plugins/Skript/scripts/bPay/messages.yml" is not set: download from "https://pastebin.com/raw/SaLF4heQ" to "plugins/Skript/scripts/bPay/messages.yml" set {bPay::message::correctusage} to yaml value "correctusage" from file "plugins/Skript/scripts/bPay/messages.yml" set {bPay::message::toosmallamount} to yaml value "toosmallamount" from file "plugins/Skript/scripts/bPay/messages.yml" set {bPay::message::wrongplayer} to yaml value "wrongplayer" from file "plugins/Skript/scripts/bPay/messages.yml" set {bPay::message::druingabsenceyougotmoney} to yaml value "duringabsenceyougetmoney" from file "plugins/Skript/scripts/bPay/messages.yml" set {bPay::message::youdonthavemoney} to yaml value "youdonthavemoney" from file "plugins/Skript/scripts/bPay/messages.yml" set {bPay::message::successtransfer} to yaml value "successtransfer" from file "plugins/Skript/scripts/bPay/messages.yml" set {bPay::message::yougotamoney} to yaml value "yougotamoney" from file "plugins/Skript/scripts/bPay/messages.yml" function bPay(p: player, o: offlineplayer, n: integer, t: text): if {_p}'s balance >= {_n}: remove {_n} from {_p}'s balance add {_n} to {_o}'s balance set {_message} to {bPay::message::successtransfer} replace all "{MONETY}" with "%{_n}%" in {_message} replace all "{GRACZ}" with "%{_o}%" in {_message} replace all "{STATUS}" with "%{_t}%" in {_message} send "%coloured {_message}%" to {_p} if {_t} is "&6&lONLINE": set {_message} to {bPay::message::yougotamoney} replace all "{MONETY}" with "%{_n}%" in {_message} replace all "{GRACZ}" with "%{_p}%" in {_message} send "%coloured {_message}%" to {_o} stop if {_t} is "&6&lOFFLINE": if yaml value "pay.%{_o}%" from file "plugins/Skript/scripts/bPay/players.yml" is set: set {_kwota} to yaml value "pay.%{_o}%.%{_p}%" from file "plugins/Skript/scripts/bPay/players.yml" set yaml value "pay.%{_o}%.%{_p}%" from file "plugins/Skript/scripts/bPay/players.yml" to ({_n} + {_kwota}) stop set yaml value "pay.%{_o}%.%{_p}%" from file "plugins/Skript/scripts/bPay/players.yml" to {_n} stop send "%coloured {bPay::message::youdonthavemoney}%" to {_p} stop command /pay [] []: trigger: if arg 1 is not set: send "%coloured {bPay::message::correctusage}%" stop if arg 2 is not set: send "%coloured {bPay::message::correctusage}%" stop if arg 1 is set: if arg 2 is set: if arg 1 is not player: if arg 2 > 0: if arg 1 is online: bPay(player, arg 1, arg 2, "&6&lONLINE") else: bPay(player, arg 1, arg 2, "&6&lOFFLINE") else: send "%coloured {bPay::message::toosmallamount}%" else: send "%{bPay::message::wrongplayer}%" on join: if yaml nodes "pay.%player%" from file "plugins/Skript/scripts/bPay/players.yml" is set: set {_list::*} to yaml nodes "pay.%player%" from file "plugins/Skript/scripts/bPay/players.yml" loop {_list::*}: set {_placacy} to loop-value set {_kwota} to yaml value "pay.%player%.%{_placacy}%" from file "plugins/Skript/scripts/bPay/players.yml" delete yaml value "pay.%player%" from file "plugins/Skript/scripts/bPay/players.yml" add {_kwota} to player's balance set {_message} to {bPay::message::druingabsenceyougotmoney} replace all "{KWOTA}" with "%{_kwota}%" in {_message} replace all "{PLACACY}" with "%{_placacy}%" in {_message} send "%coloured {_message}%"