개인 자료란 (JE)

  서버 커뮤니티

Profile 고사뤼 대표칭호 없음
Profile

질문하기 스크립트

스크립트가 작동을 안하는데 수정 좀 해주실 수 있나요?

2023.07.30 조회 수 60 추천 수 0
이해도 입문자 
게임버전 (JE) 1.20.1 
게임버전 (BE) 관련없음 

on damage:

    if victim is an end crystal:

        if attacker is a player:

            set {crystal-health::%event-location%} to 20

            if {crystal-health::%event-location%} is 1:

                delete {crystal-health::%event-location%}

                message "크리스탈이 부셔짐!" to attacker

            else:

                add -1 to {crystal-health::%event-location%}

                message "남은 체력 : %{crystal-health::%event-location}%/20" to attacker

            cancel event

인데 두번째 줄에 오류가 떴다면서 Can't compare an entity with a heal reason 라고 하길래 victim이 아니라 event-entity 를 했더니

Use 'attacker' and/or 'victim' in damage/dealth events 라네요.. 이거 어떻게 해야하나요?




5개의 댓글

환타비
2023.07.30

음 2번째 줄의 if victim is an end crystal: 이거를

 

if victim is a end crystal: 이렇게 변경하시면 정상적으로 작동 됩니다!

환타비
2023.07.30
@환타비

+수정을 하면서 다른 오류들을 발견 했습니다

 

1. message "남은 체력 : %{crystal-health::%event-location}%/20" to attacker 여기 부분에서 location 뒤에 %가 하나 빠져있습니다

 

2.attacker 가 플레이어인것을 확인하고 변수에 20을 넣었는데 아마 무한으로 19 고정이 되어 있을겁니다 그럴때는 if 구문 으로 변수가 not set 일때 20을 세팅 한다 라는 구문 넣으시면 될듯 하네여

 

3. 그리고 cancel event가 마지막 구문에 있는데 탭을 한번 해주셔야 합니다 안그러면 안터지고 계속 무한으로 반복 됩니다!


아니면 2번 할때 엔드크리스탈을 들고 우클릭한다면 변수를 20으로 설정한다 하는것도 괜찮을것같네여

고사뤼
2023.07.30
@환타비

on damage:

if victim is a end crystal:

if {health::%event-location%} is not set:

cancel event

set {health::%event-location%} to 200

add -1 to {health::%event-location%}

message "남은 체력 : %{health::%event-location%}%/200" to attacker

else if {health::%event-location%} is set:

cancel event

add -1 to {health::%event-location%}

message "남은 체력 : %{health::%event-location%}%/200" to attacker

else if {health::%event-location%} is 1:

delete {health::%event-location%}

message "크리스탈이 부셔짐!" to attacker

이렇게 고쳐서 실행하니까 실행은 되는데 저랑 친구랑 데미지 공유가 안되고 친구는 아예 때렸을때 아예 얼마 나왔는지 보이지도 않아요.

그리고 그것만큼 때려서 -1/200으로 해도 없어지지도 채팅이 나오지도 않고 계속 때릴때마다 마이너스로 계속 나오네요...ㅠ

@고사뤼

한번 이렇게 해보세여

이렇게 하면 아마 터질거에여

고사뤼
2023.08.05
@환타비

그냥 바로 터지네요...

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