개인 자료란 (JE)

  서버 커뮤니티

Profile ㅣㅕㅅㄷ 대표칭호 없음
Profile

질문하기 스크립트

스크립트 오류

2024.01.25 조회 수 31 추천 수 0
이해도 초보자 
게임버전 (JE) 1.12.2 
게임버전 (BE) 관련없음 
스크립트 버전 2.5.3 

revvv.sk

options:

    기절소생후피: 30

    기절소생범위: 2

    기절시간: 15


variables:

    {카운트.player} = 1000

on damage:

    if victim is player:

        if damage cause is not void:

            if health of victim - damage <= 0:

                cancel event

                set victim's health to 10

                if {death.list::*} contains victim:

                    stop

                else:

                    play sound "BLOCK_ANVIL_PLACE" with volume 1 and pitch 1 to victim

                    send title "&c기절함" to victim for 3 seconds

                    broadcast "&c%victim%님이 기절하셨습니다."

                    add victim to {death.list::*}

                    set {카운트.player} to {@기절시간}

//------------------------------------------------------------------------------------------------------------

every 1 seconds:

    if {카운트.player} < 50:

        while {카운트.player} > 0:

            message "%{카운트.player}%" to loop-player

            if {death.list::*} contains loop-player:

                if player is not sneaking:

                    if player is not {death.list::*}:

                        set loop-player's health to {카운트.player}

                        remove 1 from {카운트.player}

                    if player is {death.list::*}:

                        set loop-player's health to {카운트.player}

                        remove 1 from {카운트.player}

                if player is sneaking:

                    if player is not {death.list::*}:

                        loop all players in radius {@기절소생범위} of player:

                if player is sneaking:

                    if player is not {death.list::*}:

                        loop all players out radius {@기절소생범위} of player:

                            set loop-player's health to {카운트.player}

                            remove 1 from {카운트.player}

            wait 1 seconds

        if {death.list::*} contains loop-player:

            remove loop-player from {death.list::*}

            play sound "ENTITY.PLAYER.DEATH" with volume 1 and pitch 1 to loop-player

            set loop-player's health to 0

            set {카운트.player} to 1000

//------------------------------------------------------------------------------------------------------------                     

on damage:

    if damage cause is not void:

        if {death.list::*} contains victim:

            cancel event            

every 1 seconds:

    apply slowness 6 without any particles to {death.list::*} for 1 seconds

    apply jump boost 200 without any particles to {death.list::*} for 1 seconds

    apply weakness 99 without any particles to {death.list::*} for 1 seconds

  

on break:

    if {death.list::*} contains player:

        cancel event


on sneak toggle:

    loop all players in radius {@기절소생범위} of player:

        if {death.list::*} contains loop-player:

            if player is not loop-player:

                message "&e%loop-player% &e되살리는중."

                message "&e부활중." to loop-player

    wait 1 seconds

    if player is sneaking:

        loop all players in radius {@기절소생범위} of player:

            if {death.list::*} contains loop-player:

                if player is not loop-player:

                    message "&e%loop-player% &e되살리는중.."

                    message "&e부활중.." to loop-player

    wait 1 seconds

    if player is sneaking:

        loop all players in radius {@기절소생범위} of player:

            if {death.list::*} contains loop-player:

                if player is not loop-player:

                    message "&e%loop-player% &e되살리는중..."

                    message "&e부활중..." to loop-player

    wait 1 seconds

    if player is sneaking:

        loop all players in radius {@기절소생범위} of player:

            if {death.list::*} contains loop-player:

                if player is not loop-player:

                    remove loop-player from {death.list::*}

                    broadcast "&6%player%&a님이 &6%loop-player%&a님을 되살렸습니다"

                    wait 1.2 seconds

                    set health of loop-player to {@기절소생후피}

                


command /revi:

    trigger:

        remove player from {death.list::*}


command /reviv:

    trigger:

        set {카운트.player} to 0


on quit:

    if {death.list} contains player:

        remove player from {death.list::*}

        kill player

        broadcast "&a%player%님께서 기절상태에서 나가셔서 죽으셨습니다."




플레이어(A)가 죽으면 기절판정(움직임,공격불가) 후 기절시간 동안 다른 플레이어(B)가 웅크리기로 살리지 않을시 죽는 스크립트입니다

기절한 동안 다른플레이어(B)가 웅크리기를 하고 있으면 죽음카운트가 멈추고 웅크리기를 안하면 카운트가 달아 죽는 시스템입니다.

죽은 플레이어는 {death.list::*}에 저장이 됩니다.

--- 수평선 부분이 문제인데 붉은색 볼드체 loop all player, loop-player 가 죽은 플레이어(A) (={death.list::*}에 저장된 플레이어) 를 지칭하는 것입니다. 그런데 스크립트에서 오류가 나더군요 해결방법이 있을까요?



1개의 댓글

코코냐
2024.01.25

loop-player가 있는 루프문 바깥에 작성된 코드입니다. 코드 구조 자체가 잘못되었습니다.

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