개인 자료란 (JE)

  서버 커뮤니티

Profile 은현 대표칭호 없음

eunhyeonzzang 50e70ac1c989410d92b6cfe092e2252b

Profile

질문하기 스크립트

스크립트 아주 간단해보이는 구문 질문입니다 ㅠㅠ 제발 도움주세요

2023.04.19 조회 수 41 추천 수 0
이해도 입문자 
게임버전 (JE) 1.19.2 
게임버전 (BE) 1.19.x 
스크립트 버전 2.6.3 

options:

    @ : &f[ &e&l★ &f] &a옥션

command /옥션 [<text>] [<integer>]:

    trigger:

        arg 1 isn't set:

            message "{@@} &f/옥션 열기"

            message "{@@} &f/옥션 등록 [가격]"

            player is op:

                message "{@@} &c/옥션 초기화"

        arg 1 is "열기":

            open chest with 6 rows named "{@@}" to player

            loop 54 times:

                set slot loop-num - 1 of player's current inventory to {옥션::%loop-number%}

        arg 1 is "등록":

            arg 2 isn't set:

                message "{@@} &c가격을 입력해주세요"

            tool is air:

                message "{@@} &c등록할 아이템을 손에 들어주세요" 

                stop

            arg 2 <= 0:

                message "{@@} &c가격은 양수로만 지정가능합니다"

            arg 2 > 0:

                set {_i} to tool

                add "&a판매가격 &f: %arg 2% - %player%" to {_i}'s lore

                add {_i} to {옥션::*}

                set tool to air

                message "{@@} &f손에 든 아이템이 %arg 2%&f원에 등록되었습니다"

        arg 1 is "초기화":

            delete {옥션::*}

            message "{@@} &c옥션이 초기화되었습니다"

on inventory click:

    player's current inventory's name is "{@@}":

        cancel event

        clicked slot isn't air:

            loop clicked slot's lore:

                loop-value contains "&a판매가격":

                    set {_i} to clicked slot

                    add loop-value split at " " to {_s::*}

                    set {_p} to {_s::3} parsed as integer

                    player's money >= {_p}:

                        

                        set {_size} to size of {옥션::*}

                        loop 20 times:

                            loop-value-1 is line loop-num-2 of {_i}'s lore:

                                delete line loop-num-2 of {_i}'s lore

                        give {_i} to player

                        remove {_p} from player's money

                        set {_player} to {_s::5} parsed as player

                        add {_p} to {_player}'s money

                        send "{@@} &a당신이 올린 아이템이 판매되여 %{_p}%원을 얻었습니다" to {_player}

                        

                        message "{@@} &f아이템을 성공적으로 구매했습니다"

                        loop {옥션::*}:

                            loop-value-2 is clicked slot:

                                set {_n} to loop-index parsed as integer

                                set {_loop} to size of {옥션::*} - {_n}

                                loop {_loop} times:

                                    set {_n+1} to {_n} + 1

                                    set {옥션::%{_n}%} to {옥션::%{_n+1}%}

                                    add 1 to {_n}

                                delete {옥션::%{_size}%}

                                execute player command "/옥션 열기"

                                stop

                    else:

                        message "{@@} &c돈이 부족합니다"


위 구문에서요 

            arg 2 > 0:

                set {_i} to tool

                add "&a판매가격 &f: %arg 2% - %player%" to {_i}'s lore

                add {_i} to {옥션::*}

                set tool to air

                message "{@@} &f손에 든 아이템이 %arg 2%&f원에 등록되었습니다"


이 부분을   add "&a판매가격 &f: %arg 2% 원 - 판매자 %player%" to {_i}'s lore

이렇게 %arg 2%와 %player% 중간에 다른 글자를 집어넣으면

적용이 안되는데 무슨 원리고 어떻게 고쳐야되는지 알고싶습니다


스크립트 입문이다보니까 이것저것 받아와서 수정해보고있는데 여기서부터 막히네요 ㅠ

고수님들 도움 부탁드립니다




Warning
댓글이 없습니다.

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

뉴스 및 창작물
/files/thumbnails/797/788/003/262x150.crop.jpg?20240515090924

건축

마인크래프트로 구현한 카르카손 보드게임

Warak

2024-05-15

1

/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