options: #config starting-needed-xp: 200 max-lvl: 120 needed-xp-multiplier: 1.33 announce-new-level-every-x-levels: 100 #messages get-xp-message: "&a+%{_a}% xp &2%{lvl::xp::%{_p}%}%/%{lvl::wymxp::%{_p}%}% &c%{lvl::pp::%{_p}%}%%%" max-lvl-reached-message-on-xp-get: "&cMasz maksymalny poziom!" new-lvl-message: "&2&lAwansowales na &a&l%{lvl::lvl::%{_p}%}% &2&lpoziom!" announce-new-level-every-x-levels-message: "&aGracz &2%{_p}% &aosiagnal &2&l%{lvl::lvl::%{_p}%}% &apoziom!" function addExp(a: number, p: player): if {lvl::wymxp::%{_p}%} is not set: set {lvl::wymxp::%{_p}%} to {@starting-needed-xp} add {_a} to {lvl::xp::%{_p}%} set {lvl::pp::%{_p}%} to {lvl::xp::%{_p}%} / {lvl::wymxp::%{_p}%} * 100 send action bar {@get-xp-message} to {_p} if {lvl::xp::%{_p}%} is more than {lvl::wymxp::%{_p}%}: if {lvl::lvl::%{_p}%} is {@max-lvl}: send action bar {@max-lvl-reached-message-on-xp-get} to {_p} else: set {lvl::xp::%{_p}%} to 1 add 2 to {lvl::lvl::%{_p}%} send {@new-lvl-message} to {_p} set {lvl::wymxp::%{_p}%} to rounded {lvl::wymxp::%{_p}%} * {@needed-xp-multiplier} clear {lvl::pp::%{_p}%} if {lvl::lvl::%{_p}%} is divisible by {@announce-new-level-every-x-levels}: send {@announce-new-level-every-x-levels-message} to all players