개인 자료란 (JE)

  서버 커뮤니티

Profile 범래 대표칭호 없음
Profile

질문하기 스크립트

GUI 상점 스크립트

2023.12.25 조회 수 92 추천 수 0
이해도 입문자 
게임버전 (JE) 1.19.3 
게임버전 (BE) 관련없음 
스크립트 버전 2.6.4 

시티즌 플러그인에 스크립트를 연동해서 3줄 짜리 GUI 광물상점을 만들었는데 

상점.sk 

사진 처럼 판매나 구매가 안되고 아이템이 계속 옮겨지기만 하네요

set {_a} to 10

            loop 7 times:

                if index of slot is {_a}:

                    set {_b} to {_a}-9

                    if click type is right mouse button:

                        if player has space for 1 of {_%{_b}%번}:

                            set {_구매가} to {_%{_b}%번가격2}

                            if {돈.%uuid of player%} >= {_구매가}:

                                subtract {_구매가} from {돈.%uuid of player%}

                                give player 1 of {_%{_b}%번}

                                message "{@c} %{_%{_b}%번이름}%&f을(를) 1개 구매하셨습니다!"

                    if click type is right mouse button with shift:

                        if player has space for 64 of {_%{_b}%번}:

                            set {_구매가} to {_%{_b}%번가격2}*64

                            if {돈.%uuid of player%} >= {_구매가}:

                                subtract {_구매가} from {돈.%uuid of player%}

                                give player 64 of {_%{_b}%번}

                                message "{@c} %{_%{_b}%번이름}%&f을(를) 64개 구매하셨습니다!"

                    if click type is left mouse button:

                        loop player's inventory:

                            if loop-value-2 is {_%{_b}%번}:

                                if name of loop-value-2 is not set:

                                    add 1 to {_item}

                        if {_item} >= 1:

                            set {_구매가} to {_%{_b}%번판매가격2}

                            remove 1 of {_%{_b}%번} from player's inventory

                            add {_구매가} to {돈.%uuid of player%}

                            message "{@c} %{_%{_b}%번이름}%&f을(를) 1개 판매하셨습니다!"

                    if click type is left mouse button with shift:

                        loop player's inventory:

                            if loop-value-2 is {_%{_b}%번}:

                                if name of loop-value-2 is not set:

                                    set {_tem} to loop-value-2

                                    message "%{_tem}%"

                                    set {_tem} to "%{_tem}%"

                                    replace all "%{_%{_b}%번}%" and "s" and " " with "" in {_tem}

                                    set {_tem} to {_tem} parsed as integer

                                    message "%{_tem}%개"

                        if {_tem} >= 64:

                            set {_구매가} to {_%{_b}%번판매가격2}*64

                            remove 64 of {_%{_b}%번} from player's inventory

                            add {_구매가} to {돈.%uuid of player%}

                            message "{@c} %{_%{_b}%번이름}%&f을(를) 64개 판매하셨습니다!"

                add 1 to {_a}

        else:

            cancel event

+추가본



7개의 댓글

라아아아밍
2023.12.25

파일 코드에서 if name of current inventory contains "&e광물상점2":
를 일단 if name of current inventory contains "&6광물상점2": 고치시면 되지 않을까 생각합니다.
혹시 다른 문제도 생기면 말해주세요

범래
2023.12.25
@라아아아밍

파일 코드에서 113번째 문단의 코드가 에러가 뜨네요..

라아아아밍
2023.12.25
@범래

오류 메시지를 보내주실 수 있을까요?

범래
2023.12.25
@라아아아밍

사진 추가 하겠습니다

 

라아아아밍
2023.12.25
@범래

아 오류 메시지를 이제 봤네요;; 오류 메시지대로 index of slot 이라는 구문을 알 수 없다는 뜻이라서 clicked raw slot으로 수정하시면 될 듯 합니다.

범래
2023.12.25
@라아아아밍

그래도 안되네요.. if clicked raw slot  is {_a}:  이렇게 적었는데 또 같은 에러가

  

환타비
2023.12.26
@범래

if "%index of clicked slot%" is "{_a}": 이런식으로 해보세용!

뉴스 및 창작물
/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

/files/thumbnails/762/770/003/262x150.crop.jpg?20240418073724

레드스톤

T.B.H (고민중독) | 노트블럭 버전 | NoteBlock Cover [한국어 영어 중국어 가사 추가]

노트블럭전문가

2024-04-18

1