개인 자료란 (JE)

  서버 커뮤니티

Profile 쿼카곰 대표칭호 없음
Profile

질문하기 스크립트

스크립트 코드 질문 드립니다

2023.11.30 조회 수 80 추천 수 0
이해도 초보자 
게임버전 (JE) 1.20.1 
게임버전 (BE) 1.20.x 
스크립트 버전 2.7.2 
스크립트 애드온 skRayFall, SkBee 

command /랜덤텔포 [<player>]:

    trigger:

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

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

        set {_y} to 255

        set {_x1} to round player's location's x coord

        set {_z1} to round player's location's z coord

        add {_x1} to {_x}

        add {_z1} to {_z}

        set {_loc} to location at {_x}, {_y}, {_z}

        loop 255 times:

            if block at {_loc} is not minecraft:air:

                add 1 to {_y}

                set {_loc} to location at {_x}, {_y}, {_z}

                teleport arg 1 to {_loc}

                stop

            else:

                subtract 1 from {_y}

                set {_loc} to location at {_x}, {_y}, {_z}

                teleport arg 1 to {_loc}


라는 코드를 작성해서 사용하면 [<player>]에 해 당하는 닉네임을 가진 유저가 티피가 되는데 콘솔로 실행하면 아무 작동을 안하네요

어느 부분을 수정 해야 할까요

6개의 댓글

세찐찐
2023.12.01

set {_x1} to round player's location's x coord

set {_z1} to round player's location's z coord

 

이부분에서 round player’s locations’s는 실행자 플레이어가 기준이 되는건데 실행자가 콘솔이라 그렇고

 

arg 1 -> arg-1 이런식으로 해보거나

 

set {_p} to arg-1 이런식으로 하여 임시변수로 지정을 해보세요

쿼카곰
2023.12.01
@세찐찐

set {_x1} to round player's location's x coord

 

set {_z1} to round player's location's z coord

 

이 코드의 player's를 command 안에 있는 arg 1 의 플레이어로 인식하게는 못할까요?

멀티 서버에서 특정 플레이어만 랜덤으로 티피 시키려고 하는데

geniusman
2023.12.01

@=tab
콘솔로 실행하면 실행자가 콘솔창이 되어 텔레포트가 안되는 겁니다 그러니까 그냥 모든 플레이어를 텔레포트 시키죠

여러명이서 테스트는 못해봤지만 될겁니다.

command /랜덤워프:

@trigger:

@@set {_player::*} to all players

@@set {_size} to size of {_player::*}

@@loop {_size} times:

@@@set {_x} to random integer between -500 and 500

@@@set {_z} to random integer between -500 and 500

@@@set {_y} to 70

@@@loop 100 times:

@@@@if block at location {_x}, {_y}-1, {_z} is air:

@@@@@subtract 1 from {_y}

@@@@else:

@@@@@stop loop

@@@loop 100 times:

@@@@if block at location {_x}, {_y}, {_z} is not air:

@@@@@add 1 to {_y}

@@@@else:

@@@@@stop loop

@@@if block at location {_x}, {_y}, {_z} is air:

@@@@teleport {_player::%loop-number%} to location({_x}, {_y}, {_z})

쿼카곰
2023.12.01
@geniusman

텔포는 되는 여전히 콘솔 명령어로는 실행이 안되네요...

geniusman
2023.12.02
@쿼카곰

근데 왜 콘솔로 실행시키나요? 어떨때 사용하시는건가요?

쿼카곰
2023.12.02
@geniusman

트위치등 후원 인식 플러그인과 인식 시켜서 명령어를 실행하게 하려고 하는데 콘솔에서 명령어가 들어가는것 같더라고요

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