Code:
if arg 1 is 1:
wait 3 tick
open chest with 6 row named "&cusershop" to player
wait 1 tick
if size of {list::*} <= 45:
loop {list::*}:
set {usvalue::*} to split "%loop-value%" at "/"
set {count} to {usvalue::2} parsed as integer
set {item} to {tool::%loop-index%}
format slot loop-index parsed as integer - 1 of player with {count} of {item} to close then run [execute player command "/usershopbuy 1 %loop-index%"]
I have a problem in last line, "format slot..".
It shows well but if i click the first item in gui, at the end, the loop-index part is recognized as the last index.
Umm.. to put it more simply,
when I click first element(16 of brick), gui runs /usershopbuy 1 3, not /usershopbuy 1 1
I think back of "then run" is read after the click.
I can't think of any other way.
I'm really sorry if it's difficult for you to understand since my English is not good.
Last edited: