command /sklep [<player>]:
trigger:
open chest with 6 rows named "SKLEP" to player-arg
wait 2 tick
loop 54 times:
format slot loop-number -1 of player-arg with light gray glass pane to be unstealable
set {_111::*} to configuration section "sklep.itemy" get of "plugins/Skript/config.yml"
set {_sloty} to 0
loop {_111::*}:
set {_coinsy::%loop-value%} to single value "sklep.itemy.%loop-value%" get of "plugins/Skript/config.yml" parsed as integer
set {_2::%loop-value%} to loop-value parsed as item
format slot {_sloty} of player-arg with {_2::%loop-value%} with lore "&6&lCena: &9&l%{_coinsy::%loop-value%}%" to close then run [execute player-arg command "kup s %{_2::%loop-value%}% %{_coinsy::%loop-value%}%"]
add 1 to {_sloty}
komenda na kupowanie:
Spoiler
command /kup [<text>] [<item>] [<integer>]:
trigger:
if arg-1 is not set:
send "Unknown command. Type ""/help"" for help."
stop
if player is op:
if arg-1 is "s":
set {_coinsy} to single value "coinsy" get of "plugins/Skript/Gracze/%player%.yml" parsed as integer
set {_::*} to yaml list "stale itemy" of file "plugins/Skript/Gracze/%player%.yml"
loop {_::*}:
set {_} to loop-value parsed as item
if arg-2 is {_}:
send "juz kupiłes %arg-2%"
stop
if {_coinsy} >= arg-3:
add "%arg-2%" to yaml list "stale itemy" of file "plugins/Skript/Gracze/%player%.yml"
send "&2Kuipono %arg-2%"
else:
send "Niemasz tyle hajsu"
problem wygląda tak itemki sie pokazują kasa w lore jest pokazywana ale jak klikam na jakikolwiek item to kupuje zawsze mi ostatni loopwany item pomocy czyli jak klikam np perełki to i tak kupi mi stone
Pytanie
kaol48s 211
Witam ,mam zrobiony config w YML i chciałbym z niego skorzystać w sklepie w pliku YML jest:
sklep: itemy: 16 ender pearl: 1000 diamond helmet of protection 4: 1000 dirt: 1 stone: 100a kod do GUI:
komenda na kupowanie:
problem wygląda tak itemki sie pokazują kasa w lore jest pokazywana ale jak klikam na jakikolwiek item to kupuje zawsze mi ostatni loopwany item pomocy czyli jak klikam np perełki to i tak kupi mi stone
Odnośnik do komentarza
https://skript.pl/temat/18190-gui/Udostępnij na innych stronach
6 odpowiedzi na to pytanie
Rekomendowane odpowiedzi