개인 자료란 (JE)

  서버 커뮤니티

Profile 뚱땅이 대표칭호 없음
Profile

질문하기 스크립트

돈 스크립트 질문있습니다.

2021.07.06 조회 수 105 추천 수 0
이해도 1.12 
게임버전 (JE) 버킷 
스크립트 버전 입문자(아무것도 몰라요) 

스크립트는 잘 모르지만 만두민님 강의보고 짜보았습니다. 위에 돈 추가 삭감하는 부분은 잘 되는데

제가 이걸 스코어보드로 오른쪽에 유저마다 얼마 있는지 보여주는걸 하고싶어서요. 

스코어보드쪽이 궁금한데  set score "돈 : %{%player%.money}%" in sidebar of loop-player to 1 여기서 에러가 나더라구요.

혹시 어떻게 해야하는지 도와주실 분 계실까요?

만두민님 강의에서는 1초마다 반복이었는데 플레이어의 돈이 증가, 감소할때마다 스코어보드가 새로고침되는 방법도 알고싶습니다

-----------------------------------------------------------------------------------------------------------------------------------------


command /돈 [<string>] [<integer>]:

    trigger:

        if arg 1 is "추가":

            if player is op:

                add arg 2 to {%player%.money}

                message "돈이 %arg 2%원만큼 증가했습니다."

            else:

                message "추가 불가"

        

        if arg 1 is "삭감":

            if player is op:

                subtract arg 2 from {%player%.money}

                message "돈이 %arg 2%원만큼 줄었습니다."

            else:

                message "삭감 불가"

    

every 1 seconds:

    loop all players:

        if {scoreboard.%loop-player%} is true:

            wipe loop-player's sidebar

            set name of sidebar of loop-player to "지갑"

            set score "돈 : %{%player%.money}%" in sidebar of loop-player to 1

            

command /지갑 [<string>]:

    trigger:

        if arg 1 is "열기":

            set {scoreboard.%player%} to true

            

        if arg 1 is "닫기":

            set {scoreboard.%player%} to false

            wipe player's sidebar

        


4개의 댓글

DDang_
2021.07.06

돈.%loop-player%

뚱땅이
2021.07.07
@DDang_

감사합니다!!

스크립터브혼
2021.07.07
every 1 seconds:
    loop all players:
        if {scoreboard.%loop-player%} is true:
            wipe loop-player's sidebar
            set name of sidebar of loop-player to "지갑"
            set score "돈 : %{%loop-player%.money}%" in sidebar of loop-player to 1

밑줄친 부분을 바꾸시면 됩니다.


위 코드가 1초마다 플레이어의 스코어 보드를 적용하는 코드입니다.

스코어 보드에 사용되는 변수들이 변경 될 때 마다 해당 코드를 실행하면 됩니다.


command /돈 [<string>] [<integer>]:
    trigger:
        if arg 1 is "추가":
            if player is op:
                add arg 2 to {%player%.money}
                wipe player's sidebar
                set name of sidebar of player to "지갑"
                set score "돈 : %{%player%.money}%" in sidebar of player to 1
                message "돈이 %arg 2%원만큼 증가했습니다."
            else:
                message "추가 불가"

이런 식으로요.

뚱땅이
2021.07.07
@스크립터브혼

감사합니다!!

뉴스 및 창작물
/files/thumbnails/268/789/003/262x150.crop.jpg?20240515192032

레드스톤

벌레먹은 돌 빠르게 제거하는 법

GlassesFilm

2024-05-15

0

/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 모드에서 악성코드 발견 3

학교가기싫다

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