개인 자료란 (JE)

  서버 커뮤니티

Profile 아리스팡팡 대표칭호 없음
Profile

질문하기 스크립트

gui 상점을 구동하는데 구문에 오류가 있습니다.

2023.12.29 조회 수 40 추천 수 0
게임버전 (JE) 1.20.1 
게임버전 (BE) 1.20.x 
스크립트 버전 2.7.3 
스크립트 애드온 skquery, skchoke 

해당 스크립트는 스터디립트님께서 만드신 스크립트인데 에센셜,시티즌 플러그인과 함께 사용되는 스크립트입니다.

실행 시 원래 skchoke 애드온이 필요하다고 명시되어있었는데 이젠 구할수도 없고 1.20 에서 구동될지 의문이라 해당 애드온을 빼고 구동해보았더니 gui 상점이 잘 동작하나,  해당부분이 콘솔에서 에러로 나와서 상점에서 아이템을 클릭해 구입하는 행동이 되지 않습니다, 해당 부분만 수정하면 정상작동 할 것 같은데 방법이 없을까요?

101번째줄
   if click item is not air: #만약 클릭한 아이템이 공기가 아니라면


#made by studyript

#2차 수정 가능합니다

#다만 2차 수정/배포시에는 출처를 반드시 남겨주세요


options:

    s : &2&l[&3&l상점&2&l]


command /상점 [<text>] [<text>] [<text>] [<integer>]:

    trigger:

        if player is op:

            if arg 1 is "추가" or "삭제" or "목록":

                if arg 1 is "추가":

                    if arg 2 is "상점" or "아이템":

                        if arg 2 is "상점":

                            if {상점목록::*} contains arg 3:

                                send "{@s} %arg 3%&2&l은 이미 있는 상점입니다"

                            else:

                                if arg 3 is set:

                                    add arg 3 to {상점목록::*}

                                    send "{@s} 상점목록에 %arg 3%&2&l(이)가 추가되었습니다"

                                else:

                                    send "{@s} 상점의 이름을 설정해 주세요"

                        if arg 2 is "아이템":

                            if {상점목록::*} contains arg 3:

                                if arg 4 is set:

                                    if player's tool is not air:

                                        if {상점.%arg 3%.진품::*} contains player's tool:

                                            send "{@s} 이 아이템은 이미 이 상점에서 거래중인 물건입니다"

                                        else:

                                            set {_product} to player's tool

                                            add {_product} to {상점.%arg 3%.진품::*}

                                            add " " to {_product}'s lore

                                            add "&4&l[ &f&l구매가격 &4&l]&r %arg 4%원" to {_product}'s lore

                                            add "&e&l[ &f&l좌클릭 &e&l]&r 구매" to {_product}'s lore

                                            add "&e&l[ &f&lShift+좌클릭 &e&l]&r 64개 구매" to {_product}'s lore

                                            add "&7##상품" to {_product}'s lore

                                            add {_product} to {상점.%arg 3%::*}

                                            send "{@s} 아이템이 %arg 3%&2&l에 추가되었습니다"

                                    else:

                                        send "{@s} 팔 물건을 들어주세요"

                                else:

                                    send "{@s} 구매가격을 설정해 주세요"

                            else:

                                send "{@s} 상점 %arg 3%&2&l은 존재하지 않는 상점입니다"

                    else:

                        send "&4[ &f사용방법 &4]"

                        send "&4[ &f/상점 추가 [상점/아이템] [상점이름] (구매가격) &4]"

                if arg 1 is "삭제":

                    if arg 2 is set:

                        if {상점목록::*} contains arg 2:

                            subtract arg 2 from {상점목록::*}

                            delete {상점.%arg 2%.진품::*}

                            delete {상점.%arg 2%::*}

                            send "{@s} %arg 2%&2&l(이)가 상점목록에서 삭제되었습니다"

                        else:

                            send "{@s} %arg 2%&2&l(은)는 존재하지 않는 상점입니다"

                    else:

                        send "&4[ &f사용방법 &4]"

                        send "&4[ &f/상점 삭제 [상점이름] &4]"

                if arg 1 is "목록":

                    if arg 2 is "상점" or "아이템":

                        if arg 2 is "상점":

                            send "&e&l&m---------------------------"

                            loop {상점목록::*}:

                                send "&e&l%{상점목록::%loop-index%}%"

                            send "&e&l&m---------------------------"

                        if arg 2 is "아이템":

                            if {상점목록::*} contains arg 3:

                                send "&e&l&m---------------------------"

                                loop {상점.%arg 3%.진품::*}:

                                    send "&e&l%{상점.%arg 3%.진품::%loop-index%}%"

                                send "&e&l&m---------------------------"

                            else:

                                if arg 3 is not set:

                                    send "{@s} 상점이름을 입력해 주세요"

                                else:

                                    send "{@s} %arg 3%&2&l은 존재하지 않는 상점입니다"

                    else:

                        send "&4[ &f사용방법 &4]"

                        send "&4[ &f/상점 목록 [상점/아이템] (상점이름) &4]"

            else:

                send "&4[ &f사용방법 &4]"

                send "&4[ &f/상점 추가 [상점/아이템] [상점이름] (구매가격) &4]"

                send "&4[ &f/상점 삭제 [상점이름] &4]"

                send "&4[ &f/상점 목록 [상점/아이템] (상점이름) &4]"

        else:

            send "{@s} 당신은 오피가 아니기에 이 명령어를 사용할 수 없습니다"


on rightclick on entity:

    if {상점목록::*} contains entity's name:

        open chest with 6 rows named "상점 %entity's name%" to player

        set {_count} to 0

        loop {상점.%entity's name%::*}:

            set slot {_count} of current inventory of player to loop-value

            add 1 to {_count}


on inventory click:

    if clicked slot > -1:

        if name of player's current inventory contains "상점":

            cancel event

            if click item is not air: #만약 클릭한 아이템이 공기가 아니라면

                set {_lore::*} to uncolored lore of click item

                loop {_lore::*}:

                    if {_lore::%loop-index%} contains "구매가격":

                        set {_buy} to {_lore::%loop-index%}

                        replace all " " and "[" and "]" and "구매가격" and "원" with "" in {_buy}

                        set {_buy} to {_buy} parsed as integer

                    if {_lore::%loop-index%} contains "##상품":

                        set {_name} to name of player's current inventory

                        replace all "상점 " with "" in {_name}

                        set {_products} to {상점.%{_name}%.진품::%clicked slot+1%}

                        if "%click type%" contains "LEFT":

                            if "%click type%" contains "SHIFT":

                                if player's money/64 >= {_buy}:

                                    subtract {_buy}*64 from player's money

                                    give 64 of {_products} to player

                                    send "{@s} 구매가 완료되었습니다"

                                else:

                                    send "{@s} 돈이 부족합니다"

                            else:

                                if player's money >= {_buy}:

                                    subtract {_buy} from player's money

                                    give 1 of {_products} to player

                                    send "{@s} 구매가 완료되었습니다"

                                else:

                                    send "{@s} 돈이 부족합니다"

1개의 댓글

피코
2023.12.30

clicked item으로 바꾸어 보세요

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

0

/files/thumbnails/218/767/003/262x150.crop.jpg?20240412130213

레드스톤

우리의 꿈 - 원피스 오프닝

노트블럭전문가

2024-04-12

0

/files/thumbnails/505/766/003/262x150.crop.jpg?20240411122306

레드스톤

기동전사 건담 수성의 마녀 | 노트블럭 커버 1

노트블럭전문가

2024-04-11

1