Onble b8a87ac9b65c4af38b11d029cb39bd86
이해도 | 초보자 |
---|---|
게임버전 (JE) | 1.19.2 |
게임버전 (BE) | 1.19.x |
안녕하세요
command /상점 [<text>]:
trigger:
if arg-1 is not set:
send "&c사용법: /상점 [이름]" to player
stop
set {_gui} to chest inventory with 6 rows named arg-1
loop 54 times:
set slot (loop-number - 1) of {_gui} to {shop.%player's uuid%::%loop-number%}
set slot 4 of {_gui} to player's skull named "%arg-1% 의 상점"
open {_gui} to player
on inventory close:
if event-inventory's name is "Onble":
loop 54 times:
set {shop.%player's uuid%::%loop-number%} to slot (loop-number - 1) of event-inventory
on inventory click:
if name of event-inventory is "Onble":
cancel event
if click type is right mouse button:
if clicked raw slot is smaller than 54:
set {_lore} to uncolored line 1 of lore of clicked item
replace all "가격" and ":" and " " and "원" with " " in {_lore}
set {_lore} to {_lore} parsed as integer
set {_item} to clicked item
delete lore of {_item}
if player has 1 of {_item}:
remove 1 of {_item} from player's inventory
add {_lore} to player's money
on rightclick with wheat:
if name of player's tool is "&f[밀 판매등록권]":
cancel event
set {_item} to wheat named "&f밀" with lore "&f가격 : &e1000원" and "&f판매여부 : &b판매가능"
loop 54 times:
if {shop.%player's uuid%::%loop-number%} is not set:
set {shop.%player's uuid%::%loop-number%} to {_item}
send "&a[밀]이 Onble에 성공적으로 등록되었습니다!" to player
remove 1 of player's tool from player's inventory
stop
if {shop.%player's uuid%::%loop-number%} is air:
set {shop.%player's uuid%::%loop-number%} to {_item}
send "&a[밀]이 Onble에 성공적으로 등록되었습니다!" to player
remove 1 of player's tool from player's inventory
stop
send "&cOnble 상점이 가득 찼습니다. 더 이상 아이템을 등록할 수 없습니다!" to player
on inventory click:
if name of event-inventory is "Onble":
cancel event
if click type is left mouse button:
if clicked raw slot is smaller than 54:
set {_slot} to clicked raw slot
set {_item} to {shop.%player's uuid%::%{_slot}%}
send "&7현재 슬롯에 등록된 아이템: %{_item}%" to player
if {_item} is air:
send "&c해당 슬롯에는 등록된 아이템이 없습니다!" to player
stop
if {_item} is not set:
send "&c해당 슬롯에는 등록된 아이템이 없습니다!" to player
stop
delete {shop.%player's uuid%::%{_slot}%} # 슬롯에서 데이터 삭제
set slot {_slot} of event-inventory to air # GUI에서 해당 슬롯 비우기
send "&a아이템을 성공적으로 회수했습니다!" to player
위 구문을 통해서 등록, 회수를 구현중인데요.등록은 정상적으로 되는거 같은데...
회수할때 아이템 인식이 한칸전 아이템으로 인식되네요..
인식은 그렇게 되는데 정작 회수는 또 클릭한 칸 아이템이 사라지고요
ex) 8번슬롯에 유리판, 9번슬롯에 밀
좌클릭 시 밀이 회수됨, 하지만 send "&7현재 슬롯에 등록된 아이템: %{_item}%" to player 여기에는 유리판이라고 출력됨.
해결방법 있을까요..? ㅠㅠㅠㅠ
댓글이 없습니다.
새로운 댓글을 등록해 주세요!