개인 자료란 (JE)

  서버 커뮤니티

Profile darkmeter 대표칭호 없음
Profile

질문하기 스크립트

갑옷 스텟 스크립트 버그

2022.07.28 조회 수 165 추천 수 0
이해도 입문자(아무것도 몰라요) 
게임버전 (JE) 1.12.2 
게임버전 (BE) 관련없음 

command /방어구설정 [<integer>] [<integer>]:

    trigger:

        if player is op:

            if arg-1 is not set:

                message "&6/방어구설정 <방어력> <체력>"

            else:

                if player's tool is air:

                    message "&c손에 장비를 들어주세요."

                else:

                    if arg-1 is not 0:

                        add "&3■방어력: %arg-1%" to lore of player's tool

                    if arg-2 is not 0:

                        add "&6■체력: %arg-2%" to lore of player's tool

every 1 second:

    loop players:

        set {_lore::*} to uncolored lore of loop-player's helmet

        

        set {_hp} to 0

        loop {_lore::*}:

            if loop-value-2 contains "■체력":

                set {_lr} to loop-value-2

                replace all "■체력" and ":" and " " with "" in 

                set {_lr} to {_lr} parsed as number

        

        set {_hp} to 0

        set {_lore::*} to uncolored lore of loop-player's chestplate

        loop {_lore::*}:

            if loop-value-2 contains "■체력":

                set {_lr} to loop-value-2

                replace all "■체력" and ":" and " " with "" in

                set {_lr} to {_lr} parsed as number

        

        set {_hp} to 0

        set {_lore::*} to uncolored lore of loop-player's leggings

        loop {_lore::*}:

            if loop-value-2 contains "■체력":

                set {_lr} to loop-value-2

                replace all "■체력" and ":" and " " with "" in {_lr}

                set {_lr} to {_lr} parsed as number

        

        set {_hp} to 0

        set {_lore::*} to uncolored lore of loop-player's boots        

        loop {_lore::*}:

            if loop-value-2 contains "■체력":

                set {_lr} to loop-value-2

                replace all "■체력" and ":" and " " with "" in {_lr}

                set {_lr} to {_lr} parsed as number

        set loop-player's max health to 10 + {_hp}/2
구문은 이렇게되는데
갑옷에 추가 체력을 적용시키고 입어봤더니 개인적으로 스텟이 늘어나는게 아니라 유저 전체가 스텟이 적용됬습니다

뭐를 고쳐야지 유저전체가 적용된게아닌 개인적으로 적용되게 할수있을까요?




3개의 댓글

qsef1256
2022.07.29

이건 논리 오류일꺼구요. {_lr}은 왜 정의해두고 안 쓰셨나요?

darkmeter
2022.07.29
@qsef1256

제가 스크립트 시작한지 얼마안되가지고 논리 오류가 먼가요 ㅎㅎ..?

그리고 {_lr}은 배포한거 고대로 써가지고 잘모르겠어요 ㅠㅠ...

qsef1256
2022.07.29
@darkmeter

제가 보기엔 이거 만들다 만 코드입니다, {_hp} 도 set 0 해놓고 다른 조치 안 했거든요. 이 코드에서는 그냥 0이에요

 

근데 지금 스텟이 적용이 되긴 된다니, 그건 이해가 안되네요. 코드 다 올리신 거 맞나요?

 

그리고 시작한 지 얼마 안된 거는 이해는 하겠는데, 남의 꺼 가져와서 이거 왜 안되냐고 묻기 전에 만든 사람한테 물어볼 생각을 하는 게 먼저 아닐까요?

 

프로그래밍은 이 코드를 자기가 만든 건지 아닌지 다 보이거든요. 좀만 물어보면 자기가 만든 거면 절대 모를 수 없는 게 튀어 나옵니다

뉴스 및 창작물
/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 모드에서 악성코드 발견

학교가기싫다

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