개인 자료란 (JE)

  서버 커뮤니티

Profile 한포동 대표칭호 없음
Profile

질문하기 스크립트

스크립트 텔레포트 오류

2021.07.24 조회 수 646 추천 수 1
이해도 1.16 
게임버전 (JE) 페이퍼 
스크립트 애드온 2.5.3 

send "&a&l게임에 입장합니다. &8&l[&e&l%number of {game::players::*}%&8&l/&e&l{@maxplayer}&8&l]" to {game::players::*}

        wait 1 tick

        if {p.1} isn't set:

            set {p.1} to player

            stop

        if {p.1} is set: 

            if {p.2} isn't set:

                set {p.2} to player

----------------------------------------------------------

command /bridge.team:

    trigger:

        if {p.1} is player:

            teleport {p.1} to location at -0.490, 63, 7.503 in world "bri"

        if {p.2} is player:

            teleport {p.2} to location at -0.534, 63, -30.473 in world "bri"

이렇게 설정하여 실행을 했지만 다른 사람은 tp 가 안되고 저만  tp 가 됩니다 혼자만 되는 가 싶어 그분만 남기고 시작을 하면 그분은 tp가 안되는 상황입니다.

몇번을 바꾸고 고쳐도 문제가 발생하여 이렇게 글 써봅니다..




14개의 댓글

스크립터브혼
2021.07.24

stop을 지우세요.

{p.1}에 값이 없는 경우 값을 넣고 멈춥니다. 해당코드가 2회 이상 동작한다면 {p.2}까지 세팅이 될 수 있지만, 1회 동작한다면 {p.1}만 세팅될 수 있습니다.

한포동
2021.07.24
@스크립터브혼

send "&a&l게임에 입장합니다. &8&l[&e&l%number of {game::players::*}%&8&l/&e&l{@maxplayer}&8&l]" to {game::players::*}

if {p.1} isn't set:

set {p.1} to player

if {p.1} is set:

if {p.2} isn't set:

set {p.2} to player

이렇게 바꿔서 해본 결과 증상이 똑같습니다.

스크립터브혼
2021.07.25
@한포동

전체 코드 올려보세요. 파일로 올리셔도 됩니다.

한포동
2021.07.25
@스크립터브혼

options:

    maxplayer: 2

    startplayer: 2

    waittime: 3

    playtime: 50

command /더브릿지 [<text>]:

    trigger:

        if arg 1 isn't set:

            send "&a&l/더브릿지 입장&f&l: &e&l더브릿지에 입장합니다."

            send "&a&l/더브릿지 퇴장&f&l: &e&l더브릿지에서 퇴장합니다."

            send "&a&l/더브릿지 관전&f&l: &e&l더브릿지를 관전합니다."

        if arg 1 is "입장":

            execute player command "bridge.game"

        if arg 1 is "퇴장":

            execute player command "bridge.quit"

        if arg 1 is "관전":

            send "아직 추가가 안됬습니다."

 

command /bridge.game:

    trigger:

        if {play::%player%} is set:

            send "&c&l이미 게임에 입장했습니다."

            stop

        if number of {game::players::*} >= {@maxplayer}:

            send "&c&l더브릿지의 인원이 모두 찼습니다."

            stop

        set {play::%player%} to true

        add player to {game::players::*}

        teleport player to location at -0.461, 80, -11.497 in world "bri"

        set gamemode of player to survival

        send "&a&l게임에 입장합니다. &8&l[&e&l%number of {game::players::*}%&8&l/&e&l{@maxplayer}&8&l]" to {game::players::*}

        wait 1 tick

        clear player's inventory

        if number of {game::players::*} >= {@startplayer}:

            if {game::task} is not set:

                set {game::task} to true

                set {_wait} to {@waittime}

                while {game::task} is true:

                    send "&e&l%{_wait}%&e&l초 후 게임이 시작됩니다." to {game::players::*}

                    remove 1 from {_wait}

                    if {p.1} isn't set:

                        set {P.1} to player:

                    if {p.1} is set:

                        if {p.2} isn't set:

                            set {p.2} to player:

                    wait 1 seconds

                    if number of {game::players::*} < {@startplayer}:

                        delete {game::task}

                        send "&a&l인원이 부족하여 게임이 종료됩니다." to {game::players::*}

                    if {_wait} <= 0:

                        set {game::task} to false

                if {game::task} is false:

                    send "&a&l게임을 시작합니다." to {game::players::*}

                    execute command "/bridge.start" by console

                    if player is {p.1}:

                        give shears of unbreaking 5 to player

                        give 200 red wool to player

                        apply haste 3 to player for 10 minutes

                        wait 1 tick

                        teleport {p.1} to location at -0.523, 63, 10.501 in world "bri"

                    if player is {p.2}:

                        give shears of unbreaking 5 to player

                        give 200 blue wool to player

                        apply haste 3 to player for 10 minutes

                        wait 1 tick

                        teleport {p.2} to location at -0.460, 63, -33.515 in world "bri"

command /bridge.quit:

    trigger:

        if {play::%player%} is not set:

            send "&a&l게임에 참여하지 않았습니다."

            stop

        delete {play::%player%}

        remove player from {game::players::*}

        send "&a&l%player%가 퇴장했습니다." to {game::players::*}

        send "&a&l게임에서 퇴장했습니다."

command /bridge.start:

    trigger:

        send "&a&l게임을 시작했습니다." to {game::players::*}

        wait {@playtime} seconds

        send "&c&l게임이 종료됐습니다." to {game::players::*}

        delete {play::*}

        delete {game::*}

command /bridge.stop:

    trigger:

        message "&c&l성공적"

        delete {play::*}

        delete {game::*}

스크립터브혼
2021.07.25
@한포동

참여한 인원은 {game::players::*} 변수에 저장되어있습니다.

참가인원이 두명이라면 {game::players::1}, {game::players::2}를 사용하시면 됩니다.

한포동
2021.07.25
@스크립터브혼

options:

    maxplayer: 2

    startplayer: 2

    waittime: 10

    playtime: 50

command /더브릿지 [<text>]:

    trigger:

        if arg 1 isn't set:

            send "&a&l/더브릿지 입장&f&l: &e&l더브릿지에 입장합니다."

            send "&a&l/더브릿지 퇴장&f&l: &e&l더브릿지에서 퇴장합니다."

            send "&a&l/더브릿지 관전&f&l: &e&l더브릿지를 관전합니다."

        if arg 1 is "입장":

            execute player command "bridge.game"

        if arg 1 is "퇴장":

            execute player command "bridge.quit"

        if arg 1 is "관전":

            send "아직 추가가 안됬습니다."

 

command /bridge.game:

    trigger:

        if {play::%player%} is set:

            send "&c&l이미 게임에 입장했습니다."

            stop

        if number of {game::players::*} >= {@maxplayer}:

            send "&c&l더브릿지의 인원이 모두 찼습니다."

            stop

        set {play::%player%} to true

        add player to {game::players::*}

        teleport player to location at -0.461, 80, -11.497 in world "bri"

        set gamemode of player to survival

        send "&a&l게임에 입장합니다. &8&l[&e&l%number of {game::players::*}%&8&l/&e&l{@maxplayer}&8&l]" to {game::players::1} and {game::players::2}

        wait 1 tick

        clear player's inventory

        if number of {game::players::*} >= {@startplayer}:

            if {game::task} is not set:

                set {game::task} to true

                set {_wait} to {@waittime}

                while {game::task} is true:

                    send "&e&l%{_wait}%&e&l초 후 게임이 시작됩니다." to {game::players::1} and {game::players::2}

                    remove 1 from {_wait}

                    wait 1 seconds

                    if number of {game::players::*} < {@startplayer}:

                        delete {game::task}

                        send "&a&l인원이 부족하여 게임이 종료됩니다." to {game::players::1} and {game::players::2}

                    if {_wait} <= 0:

                        set {game::task} to false

                if {game::task} is false:

                    send "&a&l게임을 시작합니다." to {game::players::1} and {game::players::2}

                    execute command "/bridge.start" by console

                    if {p.1} isn't set:

                        set {p.1} to player

                    if {p.1} is set: 

                        if {p.2} isn't set:

                            set {p.2} to player

                    if player is {p.1}:

                        give shears of unbreaking 5 to player

                        give 200 red wool to player

                        apply haste 3 to player for 10 minutes

                        wait 1 tick

                        teleport {p.1} to location at -0.523, 63, 10.501 in world "bri"

                    if player is {p.2}:

                        give shears of unbreaking 5 to player

                        give 200 blue wool to player

                        apply haste 3 to player for 10 minutes

                        wait 1 tick

                        teleport {p.2} to location at -0.460, 63, -33.515 in world "bri"

command /bridge.quit:

    trigger:

        if {play::%player%} is not set:

            send "&a&l게임에 참여하지 않았습니다."

            stop

        delete {play::%player%}

        remove player from {game::players::1} and {game::players::2}

        send "&a&l%player%가 퇴장했습니다." to {game::players::1} and {game::players::2}

        send "&a&l게임에서 퇴장했습니다."

command /bridge.start:

    trigger:

        send "&a&l게임을 시작했습니다." to {game::players::1} and {game::players::2}

        wait {@playtime} seconds

        send "&c&l게임이 종료됐습니다." to {game::players::1} and {game::players::2}

        delete {game::*}

command /bridge.stop:

    trigger:

        message "&c&l성공적"

        delete {play::*}

        delete {game::*}

#이렇게 해보았는데 맞나요?

스크립터브혼
2021.07.25
@한포동

{game::players::*} 리스트는 line 24의 조건문에서 2명을 초과할 수 없게 됩니다.

send 이펙트의 패턴은 send %texts% to %senders% 입니다. 복수의 데이터 사용이 가능하기 때문에

send "msg" to {game::players::*} 이렇게하면 두명 모두에게 보내집니다.


if {p.1} isn't set:
    set {p.1} to player
if {p.1} is set: 
    if {p.2} isn't set:
        set {p.2} to player

이 코드를 사용한 것에 대하여 {game::players::*} 리스트가 있기 때문에 p.1과 p.2를 설정할 필요가 없다는 것을 알려드린겁니다.

line 50부터 line66 까지의 코드를 수정하세요.


# line 50 ~ line 66

if {p.1} isn't set:
    set {p.1} to player
if {p.1} is set: 
    if {p.2} isn't set:
        set {p.2} to player
    if player is {p.1}:
        give shears of unbreaking 5 to player
        give 200 red wool to player
        apply haste 3 to player for 10 minutes
        wait 1 tick
        teleport {p.1} to location at -0.523, 63, 10.501 in world "bri"
    if player is {p.2}:
        give shears of unbreaking 5 to player
        give 200 blue wool to player
        apply haste 3 to player for 10 minutes
        wait 1 tick
        teleport {p.2} to location at -0.460, 63, -33.515 in world "bri"

여기에 사용되는 p.1, p.2를 모두 변경하세요.

한포동
2021.07.25
@스크립터브혼

그렇다면 p.1과 p.2는 {game::players::1} {game::players::2}로 변경하면 될까요?

스크립터브혼
2021.07.25
@한포동

https://www.koreaminecraft.net/scriptqna/2029902 글 다시 보시고 한번더 고민해보세요.


{game::task} 변수가 false가 되었다는 것은 게임이 시작하기 위한 조건(인원수, 대기시간)을 모두 충족했다는 의미입니다.

그렇기 때문에 당연히 {game::players::*} 리스트에는 설정한 대로 두명의 플레이어가 있습니다.


p.1 p.2를 설정하려면 (더 많은 유저수 라도) 게임에 참가한 인원인 {game::players::*} 리스트를 가지고 해야합니다.

또한 이 기능은 게임 시작 준비가 모두 된 상태여야 하므로 대기시간(while)이 지난 뒤에 오는 조건문 if {game::task} is false:에서 동작해야합니다.

한포동
2021.07.26
@스크립터브혼

if {game::task} is false:

send "&a&l게임을 시작합니다." to {game::players::*}

execute command "/bridge.start" by console

if {game::players::*} isn't set:

set {game::players::*} to {p.1}

if {game::players::*} is set:

if {game::players::*} isn't set:

set {game::players::*} to {p.2}

if player is {p.1}:

teleport {p.1} to location at 38.399, 64, -71.568 in world "park"

if player is {p.2}:

teleport {p.2} to location at 38.468, 64, -73.533 in world "park"

이렇게 해보았는데... 어떤가요..?

스크립터브혼
2021.07.26
@한포동

https://www.koreaminecraft.net/scriptqna/2149827

링크 참고하셔서 들여쓰기 맞춰서 올려주세요.

한포동
2021.07.26
@스크립터브혼
if {game::task} is false:
 send "&a&l게임을 시작합니다." to {game::players::*}
 execute command "/bridge.start" by console
 if {game::players::*} isn't set:
  set {game::players::*} to {p.1}
 if {game::players::*} is set:
  if {game::players::*} isn't set:
   set {game::players::*} to {p.2}
 if player is {p.1}:
  teleport {p.1} to location at 38.399, 64, -71.568 in world "park"
 if player is {p.2}:
  teleport {p.2} to location at 38.468, 64, -73.533 in world "park"
스크립터브혼
2021.07.26
@한포동
if {game::task} is false:
    send "&a&l게임을 시작합니다." to {game::players::*}
    execute command "/bridge.start" by console
    teleport {game::players::1} to location at 38.399, 64, -71.568 in world "park"
    teleport {game::players::2} to location at 38.468, 64, -73.533 in world "park"

앞서 말씀드렸다시피 if {game::task} is false: 조건문을 통과했다는 것은 앞선 게임 시작 조건을 모두 충족했다는 것입니다.

게임 참기 인원이 2인으로 설정되어 있기 때문에 {game::players::*} 변수는 단 두명의 플레이어만 있을 수 있기 때문에

p.1 p.2를 세팅할 필요없이 바로 텔레포트 해주면 됩니다.

한포동
2021.07.26
@스크립터브혼

성공했습니다 알려주셔서 감사합니다!!

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

/files/thumbnails/932/765/003/262x150.crop.jpg?20240410124459

레드스톤

마인크래프트 노트블록으로 만든 『 밤양갱 (Bam Yang Gang) 』

노트블럭전문가

2024-04-10

0

/files/thumbnails/403/765/003/262x150.crop.jpg?20240409190538

레드스톤

마인크래프트 노트블록으로 만든 『 밤양갱 (Bam Yang Gang) 』

Sonttukk

2024-04-09

4