#AxJobs - Skrypt na Prace on load: if yaml value "Level.Poczatkowy wymagany xp" from file "AxJobs/Config.yml" is set: send "&aPoprawnie zaladowano konfiguracje AxJobs" to console else: send "&4Konfiguracja AxJobs nie zostala pobrana!" to console send "&4Rozpoczynam pobieranie... (Tworzenie pliku)!" to console create folder "plugins/Skript/scripts/AxJobs" send "&aFolder Folder został pomyślnie stworzony!" to console create file "plugins/Skript/scripts/AxJobs/Config.yml" send "&aPlik yml został pomyślnie stworzony!" to console wait 10 tick download "https://pastebin.com/raw/JHkNT0jZ" to "plugins/Skript/scripts/AxJobs/Config.yml" if yaml value "Level.Poczatkowy wymagany xp" from file "AxJobs/Config.yml" is set: send "&aPomyslnie pobrano konfiguracje!" to console else: send "&4Pobieranie nie powiodlo sie! Pobierz config recznie! https://pastebin.com/JHkNT0jZ" to console set {_yml::*} to yaml list "Kolejnosc" from file "AxJobs/Config.yml" set {_pob::*} to "Szansa" and "Minimalna kasa", "Maksymalna kasa", "Minimalny xp", "Maksymalny xp" loop {_yml::*}: loop {_pob::*}: set {AxJobs::Config::%loop-value-1%::%loop-value-2%} to yaml value "Jobs.%loop-value-1%.%loop-value-2%" from file "AxJobs/Config.yml" set {AxJobs::Config::Mnoznik} to yaml value "Level.Mnoznik xp" from file "AxJobs/Config.yml" set {AxJobs::Config::GuiNameTop} to yaml value "Gui.Top.Name" from file "AxJobs/Config.yml" on join: remove player from {OFFLINE::*} add player to {OFFLINE::*} function createTop(t: string, i: integer) :: strings: loop {OFFLINE::*}: if {AxJobs::%loop-value%::%{_t}%::lvl} is set: add {AxJobs::%loop-value%::%{_t}%::lvl} to {_top::*} add loop-value to {_players::*} loop {_i} times: set {_max} to max({_top::*}) loop {_top::*}: if loop-value-2 = {_max}: set {_index} to loop-index delete {_top::%{_index}%} add "%{_players::%{_index}%}% -> %{_max}%" to {_return::*} delete {_players::%{_index}%} return {_return::*} function AxJobs_LvlUZG(p: offlineplayer, t: text): if {AxJobs::%{_p}%::%{_t}%::xp} is not set: set {AxJobs::%{_p}%::%{_t}%::lvl} to 1 set {AxJobs::%{_p}%::%{_t}%::xpw} to yaml value "Level.Poczatkowy wymagany xp" from file "AxJobs/Config.yml" set {AxJobs::%{_p}%::%{_t}%::xp} to 0 if {AxJobs::%{_p}%::%{_t}%::xp} >= {AxJobs::%{_p}%::%{_t}%::xpw}: add 1 to {AxJobs::%{_p}%::%{_t}%::lvl} remove {AxJobs::%{_p}%::%{_t}%::xpw} from {AxJobs::%{_p}%::%{_t}%::xp} set {AxJobs::%{_p}%::%{_t}%::xpw} to {AxJobs::%{_p}%::%{_t}%::xpw}*{AxJobs::Config::Mnoznik} set {_aw} to yaml value "Wiadomosci.Awans" from file "AxJobs/Config.yml" set {_a} to yaml value "Wiadomosci.Awans wiadomosc do kazdego.level %{AxJobs::%{_p}%::%{_t}%::lvl}%" from file "AxJobs/Config.yml" replace all "{PLAYER}" with "%name of {_p}%" in {_aw} replace all "{LVL}" with "%{AxJobs::%{_p}%::%{_t}%::lvl}%" in {_aw} replace all "{JOBS}" with "%{_t}%" in {_aw} send "%colored {_aw}%" to {_p} if {_a} is set: replace all "{JOBS}" with "%{_t}%" in {_a} replace all "{PLAYER}" with "%name of {_p}%" in {_a} replace all "{LVL}" with "%{AxJobs::%{_p}%::%{_t}%::lvl}%" in {_a} send "%colored {_a}%" to all players function AxJobs_Glowna(p: player, t: text): chance of {AxJobs::Config::%{_t}%::szansa}%: AxJobs_LvlUZG({_p}, "%{_t}%") set {_msg} to yaml value "Wiadomosci.Zdobyles" from file "AxJobs/Config.yml" set {_kasa} to random number between {AxJobs::Config::%{_t}%::Minimalna kasa} and {AxJobs::Config::%{_t}%::Maksymalna kasa} set {_xp} to random number between {AxJobs::Config::%{_t}%::Minimalny xp} and {AxJobs::Config::%{_t}%::Maksymalny xp} add {_xp} to {AxJobs::%{_p}%::%{_t}%::xp} add {_kasa} to {_p}'s balance replace all "{LVL}" with "%{AxJobs::%{_p}%::%{_t}%::lvl}%" in {_msg} replace all "{XP}" with "%{_xp}%" in {_msg} replace all "{JOBS}" with "%{_t}%" in {_msg} replace all "{MONEY}" with "%{_kasa}%" in {_msg} set action bar of {_p} to "%colored {_msg}%" on break: if event-block is stone or cobblestone: AxJobs_Glowna(player, "Gornik") if event-block is any wood or any planks: AxJobs_Glowna(player, "Drwal") on place: AxJobs_Glowna(player, "Budowniczy") if event-block is tnt: AxJobs_Glowna(player, "Pirotechnik") if event-block is redstone or redstone block or hopper or redstone torch or button or lever or trapdoor or redstone lamp or repeater or any pressure plate or piston or sticky piston or dispenser or dropper: AxJobs_Glowna(player, "Mechanik") if event-block is diamond block or gold block or iron block or emerald block or lapis block or redstone block: AxJobs_Glowna(player, "Jubiler") on fishing: AxJobs_Glowna(player, "Wedkarz") on death: if attacker is online: AxJobs_Glowna(attacker, "Lowca") on chat: AxJobs_Glowna(player, "Pisarz") on command: AxJobs_Glowna(player, "Pisarz") command /jobs [] []: aliases: /praca, /prace executable by: player trigger: if arg 1 is "help" or "pomoc": loop (yaml list "Wiadomosci.Pomoc" from file "AxJobs/Config.yml"): set {_lv} to "%loop-value%" send colored {_lv} if arg 1 is "stat" or "stats" or "staty": loop (yaml list "Wiadomosci.Staty.Wiadomosci Gora" from file "AxJobs/Config.yml"): set {_lv} to "%loop-value%" send colored {_lv} loop (yaml list "Kolejnosc" from file "AxJobs/Config.yml"): if yaml value "Jobs.%loop-value%.Szansa" from file "AxJobs/Config.yml" is set: AxJobs_LvlUZG(player, "%loop-value%") set {_f} to yaml value "Wiadomosci.Staty.Format" from file "AxJobs/Config.yml" replace all "{JOBS}" with "%loop-value%" in {_f} replace all "{LVL}" with "%{AxJobs::%player%::%loop-value%::lvl}%" in {_f} replace all "{XP}" with "%{AxJobs::%player%::%loop-value%::xp}%" in {_f} replace all "{XP-W}" with "%{AxJobs::%player%::%loop-value%::xpw}%" in {_f} send colored {_f} if arg 1 is "top" or "topka": set {_r} to yaml value "Top.Rows" from file "AxJobs/Config.yml" set {_n} to yaml value "Top.Name" from file "AxJobs/Config.yml" open chest with {_r} rows named colored {_n} to player set {_slot} to 0 loop (yaml list "Kolejnosc" from file "AxJobs/Config.yml"): set {_i} to yaml value "Top.%loop-value%.Item" from file "AxJobs/Config.yml" set {_i} to {_i} parsed as item set {_n} to yaml value "Top.%loop-value%.Name" from file "AxJobs/Config.yml" if {_n} is set: set name of {_i} to colored {_n} set {_top::*} to createTop("%loop-value%", 10) set {_line} to 1 set {_f} to yaml value "Top.Format" from file "AxJobs/Config.yml" loop {_top::*}: set {_P::*} to loop-value-2 split at " -> " set line {_line} of lore of {_i} to colored {_f} replace all "{TOP}" with "%{_line}%" in line {_line} of lore of {_i} replace all "{NICK}" with "%{_P::1}%" in line {_line} of lore of {_i} replace all "{LEVEL}" and "{LVL}" with "%{_P::2}%" in line {_line} of lore of {_i} replace all "{XP}" with "%{AxJobs::%{_P::1}%::%loop-value-1%::xp}%" in line {_line} of lore of {_i} replace all "{XP-W}" with "%{AxJobs::%{_P::1}%::%loop-value-1%::xpw}%" in line {_line} of lore of {_i} add 1 to {_line} set player's current inventory's slot {_slot} to {_i} clear {_i} add 1 to {_slot} if arg 1 is "reset": if player has permission "AxJobs.reset": if arg 2 is set: loop (yaml list "Kolejnosc" from file "AxJobs/Config.yml"): clear {AxJobs::%arg 2%::%loop-value%::xpw} and {AxJobs::%arg 2%::%loop-value%::xp} and {AxJobs::%arg 2%::%loop-value%::lvl} AxJobs_LvlUZG(arg 2, "%loop-value%") send "&7Zresetowano prace &a%arg 2%" else: send "&7Poprawne uzycie: &8/prace reset " else: send "&7Nie posiadasz uprawnien!" on inventory click: set {_n} to yaml value "Top.Name" from file "AxJobs/Config.yml" if inventory name of current inventory of player is colored {_n}: cancel event