#-###############################-# # # # HeliosLvls # # (old) # #-###############################-# options: version: 1.6.1 #config starting-needed-xp: 200 max-lvl: 120 needed-xp-multiplier: 1.33 announce-new-level-every-x-levels: 10 min-level-to-use-chat: 1 #messages get-xp-message: "&a+%{_a}% xp &2%{helioslvls::xp::%{_p}%}%/%{helioslvls::wymxp::%{_p}%}% &c%{helioslvls::pc::%{_p}%}%%%" max-lvl-reached-message-on-xp-get: "&cMasz maksymalny poziom!" new-lvl-message: "&2&lAwansowałeś na &a&l%{helioslvls::lvl::%{_p}%}% &2&lpoziom!" announce-new-level-every-x-levels-message: "&cGracz &7%{_p}% &aosiągnął &7%{helioslvls::lvl::%{_p}%}% &cpoziom!" cannot-use-chat: &cMusisz osiągnąć &7%{helioslvls::other::minlvl}% &cpoziom żeby pisać na czacie! Aktualnie posiadasz &7%{helioslvls::lvl::%{_p}%} ? 0% &cpoziom. on load: set {helioslvls::other::minlvl} to {@min-level-to-use-chat} function addExp(a: number, p: player): if {helioslvls::lvl::%{_p}%} is {@max-lvl}: send action bar {@max-lvl-reached-message-on-xp-get} to {_p} stop if {helioslvls::wymxp::%{_p}%} is not set: set {helioslvls::wymxp::%{_p}%} to {@starting-needed-xp} set {_a} to ({_a} * (({helioslvls::xpmult} ? 100) / 100)) add {_a} to {helioslvls::xp::%{_p}%} set {helioslvls::pc::%{_p}%} to {helioslvls::xp::%{_p}%} / {helioslvls::wymxp::%{_p}%} * 100 send action bar {@get-xp-message} to {_p} if {helioslvls::xp::%{_p}%} is more than {helioslvls::wymxp::%{_p}%}: clear {helioslvls::xp::%{_p}%} add 1 to {helioslvls::lvl::%{_p}%} send {@new-lvl-message} to {_p} set {helioslvls::wymxp::%{_p}%} to rounded {helioslvls::wymxp::%{_p}%} * {@needed-xp-multiplier} clear {helioslvls::pc::%{_p}%} if {helioslvls::lvl::%{_p}%} is divisible by {@announce-new-level-every-x-levels}: send {@announce-new-level-every-x-levels-message} to all players function setXpMultiplier(i: integer): set {helioslvls::xpmult} to {_i} function getXpMultiplier() :: integer: return {helioslvls::xpmult} ? 0 function setLvl(p: player, i: integer): set {helioslvls::lvl::%{_p}%} to {_i} function getLvl(p: player) :: integer: return {helioslvls::lvl::%{_p}%} ? 0 command /lvl []: aliases: /poziom, /level trigger: send "&8[&c*&8]----------[&cHeliosLvls&8]----------[&c*&8]" send "&cPoziom: &7%{helioslvls::lvl::%arg-1%} ? 0%" send "&cPostęp: &7%{helioslvls::xp::%arg-1%} ? 0%&8/&7%{helioslvls::wymxp::%arg-1%} ? {@starting-needed-xp}% &8(&c%{helioslvls::pc::%arg-1%} ? 0%&c%%&8)" send "&cOtrzymywany xp: &7%{helioslvls::xpmult} ? 100%&7%%" send "&8[&c*&8]----------[&c%arg-1%&8]----------[&c*&8]" command /helioslvls [] [] []: permission: helioslvls.command permission message: &cThis server is using &7HeliosLvls &cversion &7{@version} trigger: if arg-1 is "help": send "&7Commands: " send " &c/helioslvls setlvl &7- Sets player's level" send " &c/helioslvls setmultiplier &7- Sets xp multiplier" send " &c/helioslvls reset &7- Resets every variable" if arg-1 is "setlvl": setLvl(arg-2 parsed as player, arg-3) if arg-3 is set if arg-1 is "setmultiplier": setXpMultiplier(arg-2 parsed as integer) if arg-2 is set if arg-1 is "reset": clear {helioslvls::*} on chat: if {helioslvls::lvl::%player%} ? 0 < {helioslvls::other::minlvl}: cancel event send "{@cannot-use-chat}" replace all "{LVL}" with "%{helioslvls::lvl::%player%} ? 0%" in chat format on join: if player has permission "helioslvls.notify": set {_version} to text from "https://pastebin.com/raw/DZAxeg0Q" wait 1 tick if {_version} is "{@version}": stop send "&8[&cHeliosLvls&8] &cNew update is available! You have &7{@version}&c, latest is &7%{_version}%" send "&7https://skript.pl/temat/35250-helioslvls-skrypt-na-poziomy-na-serwer-rpg/"