개인 자료란 (JE)

  서버 커뮤니티

Profile 데빌하트 대표칭호 없음

D3VILH4RRT a4b5e1bfdef74b93af06cbd3c8b3f76b

Profile

질문하기 스크립트

스크립트 GUI 질문

2023.12.16 조회 수 25 추천 수 0
이해도 입문자 
게임버전 (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

                                    

    




1개의 댓글

라아아아밍
2023.12.16
on inventory click:

if name of event-inventory is "&1&l테이블 코너":

if clicked raw slot is 50:

TGUI2(player)

if name of event-inventory is "&1&l테이블 코너2":

if clicked raw slot is 50:

TGUI3(player)

if name of event-inventory is "&1&l테이블 코너3":

if clicked raw slot is 50:

TGUI4(player)

if name of event-inventory is "&1&l테이블 코너4":

if clicked raw slot is 50:

             TGUI5(player)

이렇게 하시면 될 듯 합니다

contain 때문에 구분이 안 가서 그럴 거 같아요

뉴스 및 창작물
/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견

학교가기싫다

2024-05-08

1

/files/thumbnails/384/778/003/262x150.crop.jpg?20240512002324

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1

/files/thumbnails/576/775/003/262x150.crop.jpg?20240426232553

아티클

이달의 블록: 단단한 진흙

학교가기싫다

2024-04-26

0

/files/thumbnails/115/774/003/262x150.crop.jpg?20240428135129

업데이트

마인크래프트 1.20.5 정식 업데이트

학교가기싫다

2024-04-24

0