command /sklep: trigger: set {_tokeny::%player%} to yaml value "tokeny" from file "zmienne/gracze/%player%" open chest with 6 row named "&cSklep" to player wait 5 tick on join: if yaml value "tokeny" from file "zmienne/gracze/%player%" is not set: set yaml value "tokeny" from file "zmienne/gracze/%player%" to 0 set {_tokeny::%player%} to yaml value "tokeny" from file "zmienne/gracze/%player%" #Ta linijka zapisuje zmienną tymczasową. Zmienna po wykonaniu kodu się usuwa. command /tokenadmin dodaj [] []: permission : token.add trigger: if arg 1 is set: if arg 2 is set: set {_tokeny::%player-arg%} to yaml value "tokeny" from file "zmienne/gracze/%player-arg%" set {_cos} to "%{_tokeny::%player-arg%}%" parsed as integer + arg 1 set yaml value "tokeny" from file "zmienne/gracze/%player-arg%" to {_cos} set {_tokeny::%player-arg%} to yaml value "tokeny" from file "zmienne/gracze/%player-arg%" send "&f&l[&3&lINFO&f&l] &9&lObecne tokeny &6&l%{_tokeny::%player-arg%}%" else: Send "&f&l[&3&lINFO&f&l] &9&lMusisz podac gracza" else: send "&f&l[&3&lINFO&f&l] &9&lMusisz podac ilosc monet i nick gracza" command /tokenczysc []: permission: czysc.gracz trigger: if arg 1 is set: set yaml value "tokeny" from file "zmienne/gracze/%player-arg%" to 0 send "&f&l[&3&lINFO&f&l] &9&lAktualna ilosc tokenow &6&l0" else: set yaml value "tokeny" from file "zmienne/gracze/%player%" to 0 send "&f&l[&3&lINFO&f&l] &9&lAktualna ilosc tokenow &6&l0" command /tokeny [] [] [] []: trigger: if arg 1 is not set: set {_z} to "- Pokazuje stan tokenow." if sender has permission "admin.skript": set {_z} to "[] - Pokazuje stan tokenow, [Danego gracza]" send "&9&l/tokeny stan &f&l- &3&lStan tokenów Twojego konta" send "&9&l/tokeny przelej &f&l- &3&lPrzelewasz ilosc tokenow dla gracza." send "&9&l/tokeny wymien " to player send "&9&l/tokeny sprzedaj &3&l &6&l &a&l" stop if arg 1 is "stan": if arg 2 is set: if sender has permission "admin.skript": set {_arg2} to "%arg 2%" parsed as offlineplayer set {_tokeny} to yaml value "tokeny" from file "zmienne/gracze/%{_arg2}%.yml" if {_tokeny} is set: send "&f&l[&3&lINFO&f&l] Stan tokenow gracza %{_arg2}%: %{_tokeny}%" stop send "&f&l[&3&lINFO&f&l] Tego gracza nie bylo na serwerze." stop set {_tokeny} to yaml value "tokeny" from file "zmienne/gracze/%player%.yml" send "&f&l[&3&lINFO&f&l] &9&lPosiadasz: &6&l%{_tokeny}%" stop if arg 1 is "przelej": if arg 2 is not set: send "&f&l[&3&lINFO&f&l] &9&lPodaj i " stop set {_arg2} to "%arg 2%" parsed as integer if {_arg2} is not integer: send "&f&l[&3&lINFO&f&l] Ilosc tokenow musi byc liczba calkowita!" stop if {_arg2} is smaller than 1: send "&f&l[&3&lINFO&f&l] Ilosc tokenow nie moze byc mniejsza od 1" stop if arg 3 is not set: send "&f&l[&3&lINFO&f&l] &9&lPodaj gracza." set {_arg3} to "%arg 3%" parsed as offlineplayer if {_arg3} is online: set {_tokeny.%player%} to yaml value "tokeny" from file "zmienne/gracze/%player%.yml" set {_tokeny.%player%} to {_tokeny.%player%} parsed as integer set {_tokeny.%{_arg3}%} to yaml value "tokeny" from file "zmienne/gracze/%{_arg3}%.yml" set {_tokeny.%{_arg3}%} to {_tokeny.%{_arg3}%} parsed as integer if {_tokeny.%player%} is smaller than {_arg2}: send "&f&l[&3&lINFO&f&l] &9&lNie posiadasz &e&l%{_arg2}% &9<okenow. Twoj stan: &e&l%{_tokeny.%player%}%" stop add {_arg2} to {_tokeny.%{_arg3}%} remove {_arg2} from {_tokeny.%player%} set yaml value "tokeny" from file "zmienne/gracze/%player%.yml" to {_tokeny.%player%} set yaml value "tokeny" from file "zmienne/gracze/%{_arg3}%.yml" to {_tokeny.%{_arg3}%} send "&f&l[&3&lINFO&f&l] &9&lPrzelales &6&l%{_arg2}% &9<okenow dla gracza &6&l%{_arg3}%" send "&f&l[&3&lINFO&f&l] &9&lDostales &6&l%{_arg2}% &9<okenow od gracza &6&l%player%" to {_arg3} stop if arg 1 is "sprzedaj" if arg 2 is not set: send "&f&l[&3&lINFO&f&l] &c&lNie podałeś gracza, któremu chcesz sprzedać tokeny, wpisz poprawnie: &9&l/tokeny sprzedaj &3&l &6&l &a&l" stop