options: sciezka: "plugins/bLife/config.yml" on load: if yaml value "config" from file {@sciezka} is true: bLoadConfig() stop download from "https://pastebin.com/raw/NTnM6Zuq" to {@sciezka} bLoadConfig() function bLoadConfig(): #/dodajzycie set {bLife::config::1} to yaml value "poprawne-uzycie-dodajzycie" from file {@sciezka} set {bLife::config::2} to yaml value "liczba-calkowita-dodajzycie" from file {@sciezka} set {bLife::config::3} to yaml value "poprawnie-dodales-zycie-dodajzycie" from file {@sciezka} #Event ze smiercia set {bLife::config::4} to yaml value "zginiecie-z-pozostalymi-zyciami" from file {@sciezka} set {bLife::config::5} to yaml value "zginiecie-bez-pozostalych-zyc" from file {@sciezka} set {bLife::config::6::*} to yaml list "ban.powod" from file {@sciezka} set {bLife::config::7::english} to yaml value "ban.czas" from file {@sciezka} set {bLife::config::7::polish} to {bLife::config::7::english} set {_ang::*} to ("years" and "year", "months", "month", "days", "day", "hours" , "hour", "minutes" , "minute", "seconds", "second", "and") set {_pl::*} to ("lata" and "rok", "miesiace", "miesiac", "dni", "dzien", "godziny", "godzina", "minuty", "minuta", "sekundy", "sekunda", "i") loop {_ang::*}: replace all loop-value with {_pl::%loop-index%} in {bLife::config::7::polish} #/zycie set {bLife::config::8} to yaml value "koszt-jednego-zycia" from file {@sciezka} set {bLife::config::9} to yaml value "nazwa-gui" from file {@sciezka} set {bLife::config::10::name} to yaml value "gui.zakup-zycie.name" from file {@sciezka} set {bLife::config::10::lore::*} to yaml list "gui.zakup-zycie.lore" from file {@sciezka} set {bLife::config::10::item} to yaml value "gui.zakup-zycie.item" from file {@sciezka} set {bLife::config::10::slot} to yaml value "gui.zakup-zycie.slot" from file {@sciezka} set {bLife::config::11::name} to yaml value "gui.twoje-zycia.name" from file {@sciezka} set {bLife::config::11::lore::*} to yaml list "gui.twoje-zycia.lore" from file {@sciezka} set {bLife::config::11::item} to yaml value "gui.twoje-zycia.item" from file {@sciezka} set {bLife::config::11::slot} to yaml value "gui.twoje-zycia.slot" from file {@sciezka} set {bLife::config::12} to yaml value "poprawnie-zakupiles-zycie" from file {@sciezka} set {bLife::config::13} to yaml value "nie-stac-cie-aby-kupic-zycie" from file {@sciezka} #Statusy w lore /zycie set {bLife::config:14} to yaml value "nie-mozesz-zakupic-zycia" from file {@sciezka} set {bLife::config:15} to yaml value "mozesz-zakupic-zycie" from file {@sciezka} #Permisje set {bLife::config::16} to yaml value "permisja-dodajzycie" from file {@sciezka} set {bLife::config::17} to yaml value "nie-masz-permisji-dodajzycie" from file {@sciezka} #Zycia - startowe i po banie set {bLife::config::18} to yaml value "ilosc-zyc-po-banie" from file {@sciezka} set {bLife::config::19} to yaml value "ilosc-poczatkowych-zyc" from file {@sciezka} function bReturnLifeBalance(player: player, cost: integer) :: text: if {_player}'s balance >= {_cost}: return coloured {bLife::config:15} else: return coloured {bLife::config:14} function bBuyLife(player: player, cost: integer): if (uncoloured bReturnLifeBalance({_player}, {_cost})) is (uncoloured coloured {bLife::config:14}): send coloured {bLife::config::13} to {_player} stop close {_player}'s inventory add 1 to {bLife::life::%{_player}%} remove {_cost} from {_player}'s balance send coloured {bLife::config::12} to {_player} stop command /dodajzycie [] []: trigger: if player don't have permission "%{bLife::config:16}%": send coloured {bLife::config::17} stop if arg 1 is not set: send coloured {bLife::config::1} stop if arg 2 is not integer: send coloured {bLife::config::2} stop add arg 2 to {bLife::life::%arg 1%} send coloured ("%{bLife::config::3}%".replace("{ZYCIA}", "%arg 2%").replace("{GRACZ}", "%arg 1%")) command /zycie []: trigger: open virtual chest with 1 row named "%coloured {bLife::config::9}%" to player set {_lore} to join {bLife::config::10::lore::*} with "||" set {_lore} to "%{_lore}%".replace("{STATUS}", "%bReturnLifeBalance(player, ({bLife::config::8} parsed as integer))%").replace("{CENA}", "%{bLife::config::8}%") format gui slot ({bLife::config::10::slot} parsed as integer) of player with ({bLife::config::10::item} parsed as itemtype) named coloured {bLife::config::10::name} with lore coloured {_lore} to run function bBuyLife(player, ({bLife::config::8} parsed as integer)) set {_lore} to join {bLife::config::11::lore::*} with "||" set {_lore} to "%{_lore}%".replace("{ZYCIA}", "%{bLife::life::%player%}%") format gui slot ({bLife::config::11::slot} parsed as integer) of player with ({bLife::config::11::item} parsed as itemtype) named coloured {bLife::config::11::name} with lore coloured {_lore} on death of player: remove 1 from {bLife::life::%victim%} if {bLife::life::%victim%} is not 0: send coloured ("%{bLife::config::4}%".replace("{ZYCIA}", "%{bLife::life::%victim%}%").replace("{GRACZ}", "%victim%")) to all players stop send coloured ("%{bLife::config::5}%".replace("{GRACZ}", "%victim%").replace("{CZAS}", "%{bLife::config::7::polish}%")) to all players kick victim due to coloured (join {bLife::config::6::*} with "%nl%").replace("{CZAS}", "%{bLife::config::7::polish}%").replace("{DATA}", "%now%") set {bLife::ban::%victim%} to now set {bLife::life::%victim%} to ({bLife::config::18} parsed as integer) on connect: if {bLife::ban::%player%} is not set: stop if difference between {bLife::ban::%player%} and now >= ({bLife::config::7::english} parsed as timespan): stop kick player due to coloured (join {bLife::config::6::*} with "%nl%").replace("{CZAS}", "%{bLife::config::7::polish}%").replace("{GRACZ}", "%player%").replace("{DATA}", "%{bLife::ban::%player%}%") on join: if {bLife::life::%player%} is set: stop set {bLife::life::%player%} to ({bLife::config::19} parsed as integer)