D3VILH4RRT a4b5e1bfdef74b93af06cbd3c8b3f76b
이해도 | 입문자 |
---|---|
게임버전 (JE) | 1.20.1 |
게임버전 (BE) | 관련없음 |
스크립트 버전 | 2.7.2 |
GUI에서 페이지 만들 때 예를 들어 총 4개의 페이지를 만든다고 쳤을 때
4개의 상자 이름을 같은 색 코드로 1&l광물상점 , &1&l농부상점 , &1&l요리상점 , &1&l가구상점 이런 식으로 했을땐
아무 문제 없이 열리는데 &1&l광부상점1 , &1&l광부상점 2, &1&l광부상점 3 , &1&l광부상점 4 같은 이름의 넘버링만 붙였을 시
두 페이지 이상 안 만들어지는데 방법을 아시나요? 해외 커뮤니티에 묻자니 영어했을땐 잘 작동해서
options:
o : of current inventory of player
command /가구상점:
trigger:
TGUI1(player)
function TGUI1(p: player):
open chest with 6 row named "&1&l테이블 코너" to {_p}
set {_slot} to 0
loop 54 times:
set slot {_slot} of current inventory of {_p} to black stained glass pane
add 1 to {_slot}
set slot 48 of current inventory of {_p} to paper named "&e이전 페이지"
set slot 50 of current inventory of {_p} to paper named "&e다음 페이지"
function TGUI2(p: player):
open chest with 6 row named "&1&l테이블 코너2" to {_p}
set {_slot} to 0
loop 54 times:
set slot {_slot} of current inventory of {_p} to black stained glass pane
add 1 to {_slot}
set slot 48 of current inventory of {_p} to paper named "&e이전 페이지"
set slot 50 of current inventory of {_p} to paper named "&e다음 페이지"
function TGUI3(p: player):
open chest with 6 row named "&1&l테이블 코너3" to {_p}
set {_slot} to 0
loop 54 times:
set slot {_slot} of current inventory of {_p} to black stained glass pane
add 1 to {_slot}
set slot 48 of current inventory of {_p} to paper named "&e이전 페이지"
set slot 50 of current inventory of {_p} to paper named "&e다음 페이지"
function TGUI4(p: player):
open chest with 6 row named "&1&테이블 코너4" to {_p}
set {_slot} to 0
loop 54 times:
set slot {_slot} of current inventory of {_p} to black stained glass pane
add 1 to {_slot}
set slot 48 of current inventory of {_p} to paper named "&e이전 페이지"
set slot 50 of current inventory of {_p} to paper named "&e다음 페이지"
function TGUI5(p: player):
open chest with 6 row named "&1&l테이블 코너5" to {_p}
set {_slot} to 0
loop 54 times:
set slot {_slot} of current inventory of {_p} to black stained glass pane
add 1 to {_slot}
set slot 48 of current inventory of {_p} to paper named "&e이전 페이지"
set slot 50 of current inventory of {_p} to paper named "&e다음 페이지"
on inventory click:
if name of event-inventory contain "&1&l테이블 코너":
if clicked raw slot is 50:
TGUI2(player)
on inventory click:
if name of event-inventory contain "&1&l테이블 코너2":
if clicked raw slot is 50:
TGUI3(player)
on inventory click:
if name of event-inventory contain "&1&l테이블 코너3":
if clicked raw slot is 50:
TGUI4(player)
on inventory click:
if name of event-inventory contain "&1&l테이블 코너4":
if clicked raw slot is 50:
TGUI5(player)
#아이템을 구매 및 판매하는 구문
on inventory click:
if inventory name is "&1&l테이블 코너 and &1&l테이블 코너 2":
cancel event
if clicked item is black stained glass pane:
else:
if click type is left 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
if {%uuid of player%.돈} is smaller than {_lore}:
send "&c돈이 부족합니다" to player
play sound "entity.experience_orb.pickup" with volume 0.5 and pitch 1 to the player
else:
set {_item} to clicked item
delete lore of {_item}
if player has enough space for {_item}:
give {_item} to player
subtract {_lore} from {%uuid of player%.돈}
play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player
else:
send "&c&l인벤토리에 충분한 공간이 없습니다!" to player
라아아아밍
2023.12.16이렇게 하시면 될 듯 합니다
contain 때문에 구분이 안 가서 그럴 거 같아요