개인 자료란 (JE)

  서버 커뮤니티

Profile 최재웅 대표칭호 없음
Profile

질문하기 스크립트

커스텀 gui 관련 구문 질문

2024.01.11 조회 수 81 추천 수 0
이해도 초보자 
게임버전 (JE) 1.20.1 
게임버전 (BE) 관련없음 
스크립트 버전 7.3 
스크립트 애드온 SKBee,SkChoke,Skellett,SkQuery,skRayFall,skript-reflect,skUtillities 

잘 몰라서 서버에 구동중인 애드온을 다 넣었습니다.



커스텀 상점을 제작 중 입니다. 

위 사진과 같이 다음을 누르면 다음 창으로 넘어가는 구문을 작성했습니다.

if click type is left mouse button:

            if clicked raw slot is 52:

                open chest inventory with 6 row with name ":offset_-8::shop_main:" to player

그런데 이렇게 넘어가서 다시 이전을 눌러 돌아가면 새로운 창이 뜨는거지 이전에  있던 창으로 돌아가는게 아니란 걸 깨달아서 

어떻게 하면 구현이 가능할까요 ?

생각나는 방법은 상자마다 고유 코드를 붙여 그걸 여는 방법인데 그걸 모르겠습니다.


그리고 다음 질문 입니다.

command /tgui:

    trigger:

        open chest inventory with 6 row with name ":offset_-8::shop_main:" to player

        set {_slot} to 0

        loop 54 times:

            set slot {_slot} of current inventory of player to air

            add 1 to {_slot}

        set slot 19 of current inventory of player to ItemsAdder.getCustomItem("customcrops:tomato") with lore "&a■ &f구매 가격: &e50&f원" and "&7└좌클릭: 1개 구매, 쉬프트+좌클릭: 64개 구매" and "&c■ &f판매 가격: &e50&f원" and "&7└우클릭: 1개 판매, 쉬프트+우클릭: 전부 판매"

        set slot 46 of current inventory of player to ItemsAdder.getCustomItem("_iainternal:icon_left_blue")

        set slot 52 of current inventory of player to ItemsAdder.getCustomItem("_iainternal:icon_right_blue")

on inventory click:

    if inventory name is ":offset_-8::shop_main:":

        cancel event

        if click type is left mouse button:

            if clicked raw slot is smaller than 45:

                set {_lore} to uncolored line 1 of lore of clicked item

                replace all "구매" and "판매" and "가격" and "■" and ":" and " " and "원" with "" in {_lore}

                set {_lore} to {_lore} parsed as integer

                if {%uuid of player%.돈} is smaller than {_lore}:

                    send "&7돈이 부족합니다." to player

                    play sound "UI_BUTTON_CLICK" 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%.돈}

                        send "{구매판매물품}을(를) {개수}만큼 구매하였습니다.{구매or판매금액}원"

                        play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player

                    else:

                        send "&7인벤토리에 충분한 공간이 없습니다." to player

                        play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player

        else if click type is right mouse button:

            if clicked raw slot is smaller than 45:

                set {_lore} to uncolored line 3 of lore of clicked item

                replace all "구매" and "판매" and "가격" and "■" 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 {%uuid of player%.돈}

                    play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player

                else:

                    send "&7현재 해당 아이템을 가지고 있지 않아 판매할 수 없습니다." to player

                    play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player

        if click type is left mouse button:

            if clicked raw slot is 52:

                open chest inventory with 6 row with name ":offset_-8::shop_main:" to player

            if clicked raw slot is 46:

                open chest inventory with 6 row with name ":offset_-8::shop_main:" to player


위 구문

                        send "{구매판매물품}을(를) {개수}만큼 구매하였습니다.{구매or판매금액}원"

을 구현하고 싶은데 어떻게 구현하는 지 감이 잡히지 않습니다.

필요한 구문을 알려주시거나 활용가능한 이벤트 등 알려주시면 감사하겠습니다.





Warning
댓글이 없습니다.

새로운 댓글을 등록해 주세요!

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

모드

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

학교가기싫다

2024-05-08

0

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

업데이트

마인크래프트 자바 에디션 스냅샷 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