개인 자료란 (JE)

  서버 커뮤니티

Profile 최재웅 대표칭호 없음
Profile

질문하기 스크립트

스크립트 lore 감지 관련

2024.01.13 조회 수 51 추천 수 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/487/784/003/262x150.crop.jpg?20240508233607

모드

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

학교가기싫다

2024-05-08

0

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

업데이트

마인크래프트 자바 에디션 스냅샷 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