개인 자료란 (JE)

  서버 커뮤니티

Profile promine 대표칭호 없음
Profile

질문하기 스크립트

스크립트 함수 제거 관련 질문

21 일 전 조회 수 37 추천 수 0
이해도 초보자 
게임버전 (JE) 관련없음 
게임버전 (BE) 관련없음 
스크립트 버전 2.9.1 
스크립트 애드온 skllett, skquery, skrayfall 

신호기가 설치되면 설치자가 주인이 되고 주인인 사람은 범위내 버프를 받고, 아니면 디버프를 받고, 신호기가 부셔지면 버프 디보프 받지 않게 되는 스크립트인데 신호기가 부셔져도 효과가 지속 되는데 어떡하나요.

on place of beacon:

    set {_id} to "%location of event-block%"

    set {_id} to "owner"

    set {beacon::%{_id}%::owner} to player

    set {beacon::%{_id}%::location} to location of event-block


on break of beacon:

    set {_owner} to {beacon::%{_id}%::owner}

    send "&c신호기가 파괴되었습니다!" to {_owner}

    delete {beacon::%{_id}%::owner}

    delete {beacon::%{_id}%::location}

    delete {_owner}


every 2 seconds:

    loop {beacon::*}:

        set {_id} to loop-index  # 현재 반복 중인 신호기의 ID 가져오기

        set {_location} to {beacon::%{_id}%::location}  # 신호기 위치 가져오기

        set {_owner} to {beacon::%{_id}%::owner}  # 신호기 소유자 가져오기

        loop all players in radius 50 around {_location}:

            if loop-player is {_owner}:

                apply speed 2 to loop-player for 2 seconds

                apply regeneration 1 to loop-player for 2 seconds

            else:

                apply slowness 2 to loop-player for 2 seconds

                apply weakness 1 to loop-player for 2 seconds





3개의 댓글

qsef1256
21 일 전

지역 변수는 그 블록에서만 유지됩니다, 그러니까 on break of beacon: 밑에 있는 {_id}에는 아무 값도 들어가 있지 않을껍니다

promine
21 일 전
@qsef1256

음 잘모르겠네요 ㅠㅠㅠ...

 

windy_wind
20 일 전

처음부터 코드가 이상하게 짜졌네요.

index를 위치(location)으로 저장하고 불러와야하는데..

ex:

on place of beacon:

@set {beacon::%event-location%} to event-location

@set {beacon::%event-location%::owner} to event-player

 

every 20 ticks:

@loop {beacon::*}:

@@if block at loop-value is not beacon:

@@@delete {beacon:::%loop-index%} and {beacon::%loop-index%::*}

@@@continue

@@apply slowness 2 to all players in radius 50 around loop-value for 2 seconds

 

on break of beacon:

@{beacon::%event-location%} is set

@delete {beacon::%event-location%}

@send "파괴됨" to player

뉴스 및 창작물
/files/thumbnails/677/856/003/262x150.crop.jpg?20240913205849

아티클

마인크래프트 개발의 미래

학교가기싫다

2024-09-13

1

사진이 없습니다.

모드

아이리스 쉐이더

gyeol12

2024-09-07

0

/files/thumbnails/382/873/003/262x150.crop.jpg?20240903125347

레드스톤

[노트블럭커버] 숙청행진 - 밀그램

노트블럭전문가

2024-09-03

0

/files/thumbnails/069/864/003/262x150.crop.jpg?20240819102737

레드스톤

[노트블럭커버] 만찬가 - tuki

노트블럭전문가

2024-08-19

1

/files/thumbnails/647/816/003/262x150.crop.jpg?20240619112336

건축

숭례문(프리퀄) 4

KHC

2024-06-19

0