개인 자료란 (JE)

  서버 커뮤니티

Profile 최재웅 대표칭호 없음
Profile

질문하기 스크립트

스크립트 lore 감지 관련

2024.01.13 조회 수 79 추천 수 0
이해도 초보자 
게임버전 (JE) 1.20.1 
게임버전 (BE) 관련없음 
스크립트 버전 7.3 
스크립트 애드온 SKBee,SkChoke,Skellett,SkQuery,skRayFall,skript-reflect,skUtillities 

on inventory click:

    if inventory name is ":offset_-8::shop_main:":

        cancel event

        if click type is left mouse button:

            if clicked raw slot is smaller than 45:

                set {_lore} to uncolored line 1 of lore of clicked item

                replace all "구매" and "판매" and "가격" and "■" and ":" and " " and "원" with "" in {_lore}

                if lore of {_item} contains "불가":

                    cancel event

                    send "hi"

                else:

                    set {_lore} to {_lore} parsed as integer

                    if player's money is smaller than {_lore}:

                        send "&7돈이 부족합니다." to player

                        play sound "UI_BUTTON_CLICK" with volume 0.5 and pitch 1 to the player

                    else:

                        set {_item} to clicked item

                        delete lore of {_item}

                        if player has enough space for {_item}:

                            set {_amount} to item amount of clicked slot

                            set {_buy} to {_buy} / {_amount} * 1

                            set {_item} to 1 of {_item}

                            give {_item} to player

                            subtract {_lore} from player's money

                            play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player

                            send "&7아이템을 %{_amount}% 개만큼 구매하셨습니다. &e%{_lore}%원"

                        else:

                            send "&7인벤토리에 충분한 공간이 없습니다." to player

                            play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player



아이템의 lore를 감지해서 lore에 불가 라는 단어가 껴 있을 경우 구매가 불가능하게 만들고 싶습니다.

if lore of {_item} contains "불가":

                    cancel event

                    send "hi"

아래 부분까진 생각했는데 제가 원하는 대로 취소가 되지 않고 아래 구문이 진행되네요

그 이유를 알고 싶고 해결방법도 알고 싶습니다.





Warning
댓글이 없습니다.

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

뉴스 및 창작물
/files/thumbnails/932/812/003/262x150.crop.jpg?20240616121638

업데이트

마인크래프트 1.21 정식 업데이트

학교가기싫다

2024-06-14

1

/files/thumbnails/308/805/003/262x150.crop.jpg?20240605201646

레드스톤

[노트블럭 커버] 팬서비스/mona 【 HoneyWorks 】

노트블럭전문가

2024-06-05

0

/files/thumbnails/288/791/003/262x150.crop.jpg?20240602150002

아티클

《까다로운 시련》 업데이트 날짜 공개 및 정보

학교가기싫다

2024-06-02

0

/files/thumbnails/841/773/003/262x150.crop.jpg?20240526120908

레드스톤

마인크래프트 노트블록버전 『 봄을 고하다 (春を告げる) 』 [더블옥타브 버전]

노트블럭전문가

2024-05-26

0

/files/thumbnails/712/796/003/262x150.crop.jpg?20240525085438

레드스톤

마인크래프트 노트블록으로 만든 『 봄을 고하다 (春を告げる) 』 1

Sonttukk

2024-05-25

1