개인 자료란 (JE)

  서버 커뮤니티

Profile OuO_Chaton 대표칭호 없음

OuO_Chaton e42a6f60e18d43eeae9cab2397ed5f2f

Profile

질문하기 스크립트

특정 조건을 만족 시킨 플레이어한테만 메세지 보내기

2023.02.03 조회 수 356 추천 수 0
이해도 초보자 
게임버전 (JE) 1.16.5 
게임버전 (BE) 관련없음 
스크립트 버전 2.6.4 

if arg 1 is "시작":

                message "&a"

                message "&a"

                message "&a"

                message "{@b} 10초 후 &b블록숨바꼭질&f이 시작됩니다!"

                message "&a"

                message "&a"

                message "&a"

                set {_int} to 10

                loop 7 times:

                    send title "%{_int}%" to player

                    remove 1 from {_int}

                    play sound "minecraft:block.note_block.hat" with volume 2 and pitch 1 at player

                    wait 1 second

                send title "&e&l3" to player

                play sound "minecraft:block.note_block.bell" with volume 2 and pitch 1.2 at player

                wait 1 second

                send title "&6&l2" to player

                play sound "minecraft:block.note_block.bell" with volume 2 and pitch 1.2 at player

                wait 1 second

                send title "&c&l1" to player

                play sound "minecraft:block.note_block.bell" with volume 2 and pitch 1.2 at player

                wait 1 second

                send title "&a&l시작" to player

                teleport player to {hideblock}

                wait 2 tick

                play sound "minecraft:entity.firework_rocket.blast" with volume 2 and pitch 1 at player

                set {블숨.game} to "true"

            if arg 1 is "종료":

                message "&a"

                message "&a"

                message "&a"

                message "{@b} &9관리자 &f%player%님이 게임을 &c종료&f 시켰습니다."

                message "&a"

                message "&a"

                message "&a"

                set {블숨.game} to false

                loop all players:

                    clear {블숨.%loop-player%.hs}

                    clear {블숨.play.%loop-player%}

                    clear {블숨.칭호::%loop-player%}

{블숨.play.%player%}가 "true"인 값을 가지고 있는 모든 플레이어에게 위 메세지들을 보내고 싶습니다. 어떻게 작성해야 할까요?





9개의 댓글

qsef1256
2023.02.03
loop all offline players:
  {블숨.play.%loop-player%} is true
  ...

물론 loop all offline players는 플레이어가 많이 접속했었을 수록 오버헤드를 유발합니다. 그러니 배열 변수로 제작하는 것을 고려하세요.

OuO_Chaton
2023.02.04
@qsef1256

배열변수를 이용하는 방식은 어떤게 있을까요?

@qsef1256

이렇게 작성하였는데, 문제가 한명이 작동되고 나머지 한명은 앞에 한명이 완료된 후에 작동이 됩니다 ㅠ 어떻게 해야할까요

qsef1256
2023.02.04
@OuO_Chaton

그러면 메시지를 보낼 임시 플레이어 목록을 만들어 놓고, (물론 임시 변수로)

 

message "&a" to {_임시목록::*} 같이 하는 게 맞을 것 같네요

OuO_Chaton
2023.02.04
@qsef1256

조언 감사합니다 ! 잘 해결해볼게요 !

@qsef1256

음 이렇게 하는게 아닌가요 ㅠㅠ 배열변수를 잘 모르겠네요.. 어떻게 작성해야할까요?

qsef1256
2023.02.05
@OuO_Chaton


loop all players:
  if 조건:
    add loop-player to {_임시목록::*} 
message "&a" to {_임시목록::*}
OuO_Chaton
2023.02.05
@qsef1256

감사합니다 !!

크러저
2023.02.03

https://skripthub.net/docs/?id=2618

뉴스 및 창작물
/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견

학교가기싫다

2024-05-08

1

/files/thumbnails/384/778/003/262x150.crop.jpg?20240512002324

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1

/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