개인 자료란 (JE)

  서버 커뮤니티

Profile 웰치포도 대표칭호 없음
Profile

질문하기 스크립트

GUI 스크립트 질문

2023.12.16 조회 수 33 추천 수 0
이해도 입문자 
게임버전 (JE) 관련없음 
게임버전 (BE) 관련없음 
스크립트 버전 2.7.3 
스크립트 애드온 SharpSK, Skellett, SkQuery, SkRayfall, skript-gui, sKUtillties 

on inventory click:

    if inventory name is "&b상점":

        cancel event

        if click type is left mouse button:

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

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

            set {_lore} to {_lore} parsed as integer

            if {돈.%uuid of player%} is smaller than {_lore}:

                message "&c돈이 부족해을 구매할수없습니다."

                play sound "entity.experience_orb.pickup" with volume 0.5 to the player

            else:

                set {_item} to clicked item

                delete lore of {_item}

                give {_item} to player

                subtract {_lore} from {돈.%uuid of player%}

                play sound "UI_BUTTON_CLICK" with volume 0.5 to the player

        else if click type is right mouse button:

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

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

            set {_lore} to {_lore} parsed as integer

            set {_item} to clicked item

            delete lore of {_item}

            if player has 1 of {_item}:

                remove 1 of {_item} from player's inventory

                add {_lore} to {돈.%uuid of player%}

                play sound "UI_BUTTON_CLICK" with volume 0.5 to the player

                send "&e1개 판매하였습니다! "

            else:            

                message "&c아이템이 부족해 판매할수없습니다."

                play sound "entity.experience_orb.pickup" with volume 0.5 to the player

        if click type is right mouse button with shift:

            if player has 64 of {_item}:    

                remove 64 of {_item} from player's inventory

                add {_lore}*64 to {돈.%uuid of player%}

                play sound "UI_BUTTON_CLICK" with volume 0.5 to the player

                send "&e64개 판매하였습니다! "

            else:            

                message "&c아이템이 부족해 판매할수없습니다."

                play sound "entity.experience_orb.pickup" with volume 0.5 to the player

다른건 다 작동되는데 쉬프트 +우클릭 부분이 작동이 되지 않아요 인벤토리에 64개가 있는데도  판매가 안되면서

 "아이템이 부족해 판매할수없습니다." 

이렇게 떠요 도와주세요!




7개의 댓글

라아아아밍
2023.12.16

그 {_item} 변수가 쉬우 부분에서만 지정을 안 하고 쓰신 거 같은데요?

라아아아밍
2023.12.16
@라아아아밍
on inventory click:
    if inventory name is "&b상점":
        set {_item} to clicked item
        cancel event
        if click type is left mouse button:
            set {_lore} to uncolored line 1 of lore of clicked item
            replace all "구매 가격: " and "원" with "" in {_lore}
            set {_lore} to {_lore} parsed as integer
            if {돈.%uuid of player%} is smaller than {_lore}:
                message "&c돈이 부족해을 구매할수없습니다."
                play sound "entity.experience_orb.pickup" with volume 0.5 to the player
            else:
                delete lore of {_item}
                give {_item} to player
                subtract {_lore} from {돈.%uuid of player%}
                play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
        else if click type is right mouse button:
            set {_lore} to uncolored line 2 of lore of clicked item
            replace all "판매 가격: " and "원" with "" in {_lore}
            set {_lore} to {_lore} parsed as integer
            delete lore of {_item}
            if player has 1 of {_item}:
                remove 1 of {_item} from player's inventory
                add {_lore} to {돈.%uuid of player%}
                play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
                send "&e1개 판매하였습니다! "
            else:            
                message "&c아이템이 부족해 판매할수없습니다."
                play sound "entity.experience_orb.pickup" with volume 0.5 to the player
        if click type is right mouse button with shift:
            if player has 64 of {_item}:
                remove 64 of {_item} from player's inventory
                add {_lore}*64 to {돈.%uuid of player%}
                play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
                send "&e64개 판매하였습니다! "
            else:            
                message "&c아이템이 부족해 판매할수없습니다."
                play sound "entity.experience_orb.pickup" with volume 0.5 to the player
라아아아밍
2023.12.16
@라아아아밍

이렇게만 수정하셔도 문제 없이 될 거 같습니다

웰치포도
2023.12.16
@라아아아밍

근데 그래도 똑같아요....

라아아아밍
2023.12.16
@웰치포도

그러면 가지고 있는 아이템과 gui 아이템에서 다른 부분이 없는지 확인해보셔야 할 거 같습니다.

구문에서는 틀린 게 없어 보여서..

웰치포도
2023.12.16
@라아아아밍

아니면 상점 GUI 구문도 보여드릴까요?

웰치포도
2023.12.17
@라아아아밍

아 아니에요 고쳤습니다!

뉴스 및 창작물
/files/thumbnails/268/789/003/262x150.crop.jpg?20240515192032

레드스톤

벌레먹은 돌 빠르게 제거하는 법

GlassesFilm

2024-05-15

0

/files/thumbnails/797/788/003/262x150.crop.jpg?20240515090924

건축

마인크래프트로 구현한 카르카손 보드게임

Warak

2024-05-15

1

/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