개인 자료란 (JE)

  서버 커뮤니티

Profile 야옹아멍멍해봐 대표칭호 없음

Inermis_ f74bd10639544527845f60e073427a16

Profile

질문하기 스크립트

스크립트 랜덤상자 목록 저장이 안됩니다 ㅠㅠㅠ

2020.10.30 조회 수 201 추천 수 0
이해도 1.16 
게임버전 (JE) 버킷 
스크립트 애드온 2.5 

출처:https://m.blog.naver.com/PostView.nhn?blogId=sh007100&logNo=221126915669&proxyReferer=https:%2F%2Fwww.google.co.kr%2F

해당 블로그에서 받은 스크립트를 1.16.3에서 사용하려하는데

모든 기능이 작동하지만 목록 수정에 아이템을 올리고 창을 닫으면 저장이 안되고 사라집니다.. ㅠㅠ 해결방법이 있을까요?

options:

    1 : &f&l[ &6&lRandom Chest &f&l]

command /랜덤상자 [<text> ] [<text>] [<player>]:

    permission: op.op

    permission message: &c당신은 권환이 없습니다

    trigger:

        if arg 1 is not set:

            send "{@1} /랜덤상자 생성 이름 - &b&l랜덤 상자를 만듭니다."

            send "{@1} /랜덤상자 삭제 이름 - &b&l랜덤 상자를 삭제합니다."

            send "{@1} /랜덤상자 설정 이름 - &b&l랜덤 상자 아이템을 설정합니다."

            send "{@1} /랜덤상자 목록 - &b&l랜덤 상자 리스트를 확인합니다."

            send "{@1} /랜덤상자 지급 이름 플레이어 - &b&l랜덤 상자를 지급합니다."

        if arg 1 is "생성":

            if arg 2 is set:

                if {chest.random.%arg 2%} is not set:

                    set {chest.random.%arg 2%} to true

                    send "{@1} %arg 2% 를 생성하였습니다."

                    add "%arg 2%" to {chest.random.list::*}

                else:

                    send "{@1} 이미 존재하는 상자입니다."

            else:

                send "{@1} 이름을 설정해주세요"

        if arg 1 is "삭제":

            if arg 2 is set:

                if {chest.random.%arg 2%} is true:

                    clear {chest.random.%arg 2%}

                    clear {chest.random.%arg 2%.item::*}

                    loop {chest.random.list::*}:

                        if "%loop-value%" is "%arg 2%":

                            clear {chest.random.list::%loop-index%}

                            exit loop

                    send "{@1} 정상적으로 삭제되었습니다."

        if arg 1 is "목록":

            if {chest.random.list::1} is not set:

                send "{@1} 존재하는 상자가 없습니다. /랜덤상자 생성 으로 만들어보세요 !"

            if {chest.random.list::1} is set:

                send "&6&l----==== Random Chest List ====----"

                loop {chest.random.list::*}:

                    send "&f[&c%loop-index%&f] &f&l%loop-value%"

                send "&6&l----===========================----"

        if arg 1 is "설정":

            if arg 2 is set:

                if {chest.random.%arg 2%} is true:

                    open chest with 6 row named "랜덤상자 %arg 2% 아이템 설정" to player

                    loop {chest.random.%arg 2%.item::*}:

                        wait 1 tick

                        add 1 to {_player}

                        set slot {_player}-1 of current inventory of player to {chest.random.%arg 2%.item::%loop-index%}

                else:

                    send "{@1} 존재하지 않은 상자입니다."

            else:

                send "{@1} 이름을 설정해주세요"

        if arg 1 is "지급":

            if arg 2 is set:

                if {chest.random.%arg 2%} is true:

                    if arg 3 is set:

                        give chest named "&c&l%arg 2% &6&l랜덤상자" with lore "&6&l● &f&l우클릭시 랜덤상자를 엽니다." to arg 3

                        send "{@1} 정상적으로 지급되었습니다."

                        send "{@1} 랜덤 상자가 지급되었습니다." to arg 3

                    else:

                        send "{@1} 플레이어 닉네임을 적어주세요"

                else:

                    send "{@1} 존재하지 않은 상자입니다."

            else:

                send "{@1} 이름을 설정해주세요"

                        

on inventory close:

    if inventory name of current inventory of player contains "랜덤상자":

        set {_name} to uncolored inventory name of current inventory of player

        replace all "랜덤상자" and "아이템" and "설정" and " " with "" in {_name}

        clear {chest.random.%{_name}%.item::*}

        loop 54 times:

            add 1 to {_player}

            add slot {_player}-1 of current inventory of player to {chest.random.%{_name}%.item::*}

on right click with chest:

    if name of player's tool contains "랜덤상자":

        cancel event

        set {_name} to uncolored name of player's tool

        replace all "랜덤상자" and " " with "" in {_name}

        remove 1 of player's tool from player's tool

        loop {chest.random.%{_name}%.item::*}:

            if loop-value is not air:

                add 1 to {_player}

        set {_integer} to random integer between 0.1 and {_player}

        give {chest.random.%{_name}%.item::%{_integer}%} to player

        set {_item} to {chest.random.%{_name}%.item::%{_integer}%}

        send "{@1} 랜덤 상자에서 %{_item}% 을 뽑으셨습니다. "


1개의 댓글

스크립터브혼
2020.10.31

먼저, 원작자가 있는 게시물이면 원작자에게 먼저 문의해보시길 바랍니다.

인벤토리가 저장되는 부분은

on inventory close:
    if inventory name of current inventory of player contains "랜덤상자":
        set {_name} to uncolored inventory name of current inventory of player
        replace all "랜덤상자" and "아이템" and "설정" and " " with "" in {_name}
        clear {chest.random.%{_name}%.item::*}
        loop 54 times:
            add 1 to {_player}
            add slot {_player}-1 of current inventory of player to {chest.random.%{_name}%.item::*}

이 부분 입니다. 이부분의 조건문, 변수 등이 어떻게 흘러가는지 분석해 보시길 바랍니다.

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

0

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

레드스톤

우리의 꿈 - 원피스 오프닝

노트블럭전문가

2024-04-12

0