개인 자료란 (JE)

  서버 커뮤니티

Profile 데빌하트 대표칭호 없음

D3VILH4RRT a4b5e1bfdef74b93af06cbd3c8b3f76b

Profile

질문하기 스크립트

상점 스크립트를 만들었는데

2023.11.05 조회 수 37 추천 수 0
이해도 입문자 
게임버전 (JE) 1.20.1 
게임버전 (BE) 관련없음 
스크립트 버전 2.7.2 

상점  스크립트를 만들었는데  물건 구매 시 물건을 받고 돈이 빠져 나가게 는 했는데

판매 시 물건은 없어지는데 돈은 안들어오네요


command /상점2:

    trigger:

        open chest with 6 row named "&1&l상점" to player

        set {_slot} to 0

        loop 54 times:

            set slot {_slot} of current inventory of player to black stained glass pane

            add 1 to {_slot}

        set slot 0 of current inventory of player to bread with lore "&b구매가격: 50원" and "&e좌클릭 구매/우클릭 판매" and "&c판매가격: 100원"

    

on inventory click:

    if inventory name is "&1&l상점":

        cancel event

        if clicked item is black stained glass pane:

        else:

            if click type is left mouse button:

                if clicked raw slot is smaller than 54:

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

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

                    set {_lore} to {_lore} parsed as integer

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

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

                        play sound "entity.experience_orb.pickup" 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}:

                            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

                        else:

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

                                    

            else if click type is right mouse button:

                if clicked raw slot is smaller than 54:

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

                    replace all "가격":" and " " 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 player's money

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

                    else:

                        send "&c현재 해당 아이템을 가지고 있지 않아 판매할 수 없습니다" to player

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




Warning
댓글이 없습니다.

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

뉴스 및 창작물
/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

/files/thumbnails/762/770/003/262x150.crop.jpg?20240418073724

레드스톤

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

노트블럭전문가

2024-04-18

0

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

레드스톤

우리의 꿈 - 원피스 오프닝

노트블럭전문가

2024-04-12

0

/files/thumbnails/505/766/003/262x150.crop.jpg?20240411122306

레드스톤

기동전사 건담 수성의 마녀 | 노트블럭 커버 1

노트블럭전문가

2024-04-11

1