개인 자료란 (JE)

  서버 커뮤니티

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

질문하기 스크립트

스크립트 오류

2021.03.01 조회 수 111 추천 수 0
이해도 1.12 
게임버전 (JE) 스피곳 
게임버전 (BE) SkQuery, Skellett 
스크립트 애드온 최신버전 

스크립트 최신 버전 사용중인데..

철문 우클릭시 gui가 나와야 하는데 나오지가 않네요...

뭐가 잘못된건가요?

options:
    D : &a&b&c&l 


    White : White Stained Glass Pane named "&f"
    DGray : Dark Gray Stained Glass Pane named "&f"


    LGreen : Light Green Stained Glass Pane named "&a성공"


    Red : Red Stained Glass Pane named "&cFAIL"


    SlotP : of current inventory of {_p} to


function makeDoorGUI(p: player):
    loop 6 times:
        inventory name of current inventory of {_p} is "{@D}"
        set slot ((loop-num)-1) * 9  {@SlotP} {@White}
        set slot ((loop-num)-1) * 9 + 8 {@SlotP} {@White}
        loop 7 times:
            inventory name of current inventory of {_p} is "{@D}"
            set slot ((loop-num-1)-1) * 9 + (loop-num-2) {@SlotP} {@DGray}
    set {Door::%{_p}%::Status} to 0
    setDoorGUI({_p}, true)


function setDoorGUI(p: player, change: boolean):
    {_Change} is true:
        set {_Random} to random integer between 1 and 12
        set {Door::%{_p}%::Number} to (mod({_Random}, 3) + (floor(({_Random}+2)/3)) * 9 + 3)
    else:
        clear {Door::%{_p}%::Number}
    loop 3 times:
        inventory name of current inventory of {_p} is "{@D}"
        {Door::%{_p}%::Status} >= loop-num:
            set slot (loop-num * 2) {@SlotP} {@LGreen}
        else:
            set slot (loop-num * 2) {@SlotP} {@Red}
        loop 4 times:
            inventory name of current inventory of {_p} is "{@D}"
            set slot (loop-num-1) + (loop-num-2) * 9 + 2 {@SlotP} Gray Dye named "&f"
    set slot {Door::%{_p}%::Number} {@SlotP} Lime Dye named "&aCLICK"


on rightclick:
    player's Leggings isn't Leather Pants:
        {Door::Block::%block's location%} is set:
            clear {Door::Block::%block's location%}
            turn on event-block
        else:
            set {Door::Block::%block's location%} to event-block
            turn off event-block
        stop
    "%type of block%" contains "IRON_DOOR"
    open chest with 6 rows named "{@D}" to player
    makeDoorGUI(player)
    set {Door::%player%::Block} to event-block


on inventory click:
    inventory name of current inventory of player is "{@D}"
    play sound "entity.player.levelup" with volume 1 and pitch 1 at all players for player
    cancel event
    {Door::%player%::Number} is set
    {Door::%player%::Number} is click slot:
        add 1 to {Door::%player%::Status}
        {Door::%player%::Status} < 3:
            setDoorGUI(player, true)
        else:
            setDoorGUI(player, false)
            set {_Door} to {Door::%player%::Block}
            set {_Loc} to location of {_Door}
            set {Door::Block::%{_Loc}%} to true
            wait a tick
            close inventory to player
            turn on {_Door}
            play sound "block.iron_door.open" with volume 1 and pitch 1 at all players for player
            clear {Door::Block::%{_Loc}%}
    else:
        loop 12 times:
            set {_Random} to loop-num
            click slot is (mod({_Random}, 3) + (floor(({_Random}+2)/3)) * 9 + 3)
            set {Door::%player%::Status} to 0
            setDoorGUI(player, true)
            stop




on inventory close:
    inventory name of current inventory of player is "{@D}"
    clear {Door::%player%::*}


on load:
    clear {Door::*}

5개의 댓글

스크립터브혼
2021.03.01

on rightclick 이벤트에서 open 이펙트에 도달하는 구간에서 코드가 어떻게 동작하는지 확인해보세요.

각각의 변수에 어떤 값이 있고, 각각의 조건문이 어떤 판단을 하는지 메세지로 출력해보시기 바랍니다.


send "%{_a}={_a}% / {_b}=%{_b}%"
if {_a} is {_b}:
    send "[A]"
    ~
else:
    send "[B]"
    ~

open 이펙트에 도달하지 못하는 이유는 두가집니다.

첫번째 조건문(player's Leggings isn't Leather Pants)을 통과하지 못해서,
두번째 조건문("%type of block%" contains "IRON_DOOR")을 통과하지 못해서

각 조건문을 왜 통과하지 못하는지, 조건문 안밖으로 비교값을 메세지로 출력해서 확인해보시기 바랍니다.

ㅣㅕㅅㄷ
2021.03.01
@스크립터브혼

스크립트 2.4 beta 5 버전에서는 작동하는데 왜 최신 버전에서 작동 안할까요... 다른 스크립트는 beta5 버전에서 작동을 안해서 둘중 한개를 고쳐야되는데..

스크립터브혼
2021.03.01
@ㅣㅕㅅㄷ

어느 코드에서 안되나요?

ㅣㅕㅅㄷ
2021.03.01
@스크립터브혼

간단하게 스크립트를 설명 해드리자면 가죽레깅스를 입고 철문을 우클릭 하면 gui가 열리고

그 외로 철문 우클릭하면 철문이 작동 됩니다.

on rightclick:

player's Leggings isn't Leather Pants:

{Door::Block::%block's location%} is set:

clear {Door::Block::%block's location%}

turn on event-block

else:

set {Door::Block::%block's location%} to event-block

turn off event-block

여기까지는 되는거 같습니다.

레깅스를 입지 않고 우클릭을 하면 철문이 작동 되는데

레깅스를 입으면 gui 가 열리지 않습니다.

스크립터브혼
2021.03.01
@ㅣㅕㅅㄷ

"%type of block%"이 "IRON_DOOR"가 나오던가요? 아마도 아닐겁니다.

> send "%type of block%"

이렇게 메세지로 출력해 보세요.


블록이나 아이템의 마테리얼(Material)을 확인하려면 type of ~ 보다 minecraft name of ~ 가 더 명확합니다.

스크립트의 아이템 타입은 마테리얼과 다릅니다. 타입은 마테리얼보다는 별칭(aliases)에 더 가깝습니다.

예를들어 계단블록 같은걸 메세지로 출력하면 '어느방향의 무슨 재질의 계단~' 이라는 식으로 출력됩니다.

그 이유는 스크립트에서 정의한 블록의 별칭이 빙향, 재질과 같은 것을 포함하기 때문입니다.


minecraft name of ~ 를 사용하면 minecraft:~ 형태의 이름키(NamespaceKey)가 글자로 반환됩니다.

이것은 별칭과는 별개로 명확하게 지정된 이름이기 때문에 오히려 마테리얼에 가깝다고 할 수 있죠.


>  minecraft name of block is "minecraft:iron_door"

이런식으로 해보세요.

정확히 이 이름이 맞는지는 모르겠어요. 확인해보세요

뉴스 및 창작물
/files/thumbnails/762/770/003/262x150.crop.jpg?20240418073724

레드스톤

T.B.H (고민중독) | 노트블럭 버전 | NoteBlock Cover [한국어 영어 중국어 가사 추가] 1

노트블럭전문가

2024-04-18

0

/files/thumbnails/218/767/003/262x150.crop.jpg?20240412130213

레드스톤

우리의 꿈 - 원피스 오프닝 1

노트블럭전문가

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