개인 자료란 (JE)

  서버 커뮤니티

Profile 이한다 대표칭호 없음
Profile

질문하기 스크립트

tp스크립트를 만들고 싶은데 잘 안돼요 ㅠ

11 시간 전 조회 수 8 추천 수 0
이해도 입문자 
게임버전 (JE) 1.20.1 
게임버전 (BE) 관련없음 
스크립트 버전 2.9.3 

command /야생:

    trigger:

        set {_original_loc} to location of player

        

        # 텔레포트할 월드 이름

        set {_world} to world "world"

        

        # 월드의 스폰으로 텔레포트

        teleport player to spawn of {_world}

        

        # 발 밑 블록 안전 검사

        set {_block} to block at location 1 meter below location of player

        

        # 안전하지 않은 블록이면 안전한 위치로 텔레포트

        if {_block} is lava or {_block} is cactus or {_block} is water or {_block} is magma or {_block} is fire or {_block} is air:

            loop 50 times:  # 최대 50번 시도

                set {_x} to random number between -500 and 500

                set {_z} to random number between -500 and 500

                set {_y} to highest block at {_x}, {_z} in {_world}

                set {_new_loc} to location at {_x}, {_y}, {_z} in {_world}

                

                # 발 밑 블록이 안전한지 확인

                set {_new_block} to block at location 1 meter below {_new_loc}

                if {_new_block} is not lava and {_new_block} is not cactus and {_new_block} is not water and {_new_block} is not magma and {_new_block} is not fire:

                    teleport player to {_new_loc}

                    send "&a안전한 위치로 이동했습니다!" to player

                    stop

        

        send "&c안전한 위치를 찾지 못했습니다. 원래 위치로 되돌아갑니다." to player

        teleport player to {_original_loc}



해당코드에서 15라인이 계속 오류가 뜨는게 원인을 모르겠어요 ㅠㅠ

만든 이유는 멀티월드를 일반 유저도 tp할수 있게 만들려고 한겁니다.(밑에 블럭이없거나 용암이거나 마그마 블럭이거나 하면 tp가 안되고 다른 곳으로 랜덤 tp 되게 만들고 싶었어요.




Warning
댓글이 없습니다.

새로운 댓글을 등록해 주세요!

뉴스 및 창작물
/files/thumbnails/578/899/003/262x150.crop.jpg?20241010142350

건축

경주 월정교 1

KHC

2024-10-10

1

/files/thumbnails/219/899/003/262x150.crop.jpg?20241009200950

건축

송전탑+도시 2

dbasd12

2024-10-09

2

/files/thumbnails/246/898/003/262x150.crop.jpg?20241008102328

레드스톤

단다단 - 오토노케(オトノケ) | 마인크래프트 노트블럭 커버

노트블럭전문가

2024-10-08

0

/files/thumbnails/348/896/003/262x150.crop.jpg?20241006103035

디도스/봇테러등등을 낚는 방법 4

물귀신

2024-10-06

1

/files/thumbnails/839/895/003/262x150.crop.jpg?20241006021227

SRV레코드는 보안도메인이 아닙니다. [서버오픈시 필독]

물귀신

2024-10-05

2