개인 자료란 (JE)

  서버 커뮤니티

Profile promine 대표칭호 없음
Profile

질문하기 스크립트

스크립트 상점 관련 질문

2024.08.20 조회 수 74 추천 수 0
이해도 초보자 
게임버전 (JE) 관련없음 
게임버전 (BE) 관련없음 
스크립트 버전 2.9.1 
스크립트 애드온 skllett, skquery, skrayfall 

이 스크립트가 상점 스크립트인데 돈 말고 에메랄드로 살 수 있게 바 꿀 수 있나여ㅕ

command /shop:

    trigger:

        open chest with 6 row named "&a&lSHOP" to player

        play sound "minecraft:block.note_block.bell" with volume 1 and pitch 1.5 to the 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&lprice : 100 coins"

        set slot 1 of current inventory of player to apple with lore "&b&lprice : 45 coins"


on inventory click:

    if inventory name is "&a&lSHOP":

        cancel event

        if click type is left mouse button:

            if click raw slot is smaller than 54:

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

                replace all "price " and ":" and " " and "coins" with "" in {_lore}

                set {_lore} to {_lore} parsed as integer

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

                    send actionbar "&c&lThere are not enough coins" to player

                    play sound "minecraft:block.note_block.bass" with volume 1 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 {%uuid of player%.coins}

                        play sound "minecraft:block.note_block.bell" with volume 1 and pitch 0.5 to the player

                    else:

                        send actionbar "&c&lThere is not enough space in the inventory" to player

                        play sound "minecraft:block.note_block.bass" with volume 1 and pitch 1 to the player




1개의 댓글

windy_wind
2024.08.21

set {_item} to 5 of emerald

if player has {_item}:

@remove 5 of emerald

@give diamond to player

else:

@send "에메랄드 %amount of {_item}%개가 필요합니다" to player

 

를 응용하세요

뉴스 및 창작물
/files/thumbnails/761/908/003/262x150.crop.jpg?20241025153749

건축

서울 숭례문(崇禮門) 4

KHC

2024-10-25

2

/files/thumbnails/578/899/003/262x150.crop.jpg?20241010142350

건축

경주 월정교 1

KHC

2024-10-10

2

/files/thumbnails/219/899/003/262x150.crop.jpg?20241009200950

건축

송전탑+도시 2

dbasd12

2024-10-09

2

/files/thumbnails/246/898/003/262x150.crop.jpg?20241008102328

레드스톤

단다단 - 오토노케(オトノケ) | 마인크래프트 노트블럭 커버

노트블럭전문가

2024-10-08

1

/files/thumbnails/348/896/003/262x150.crop.jpg?20241006103035

디도스/봇테러등등을 낚는 방법 4

물귀신

2024-10-06

3