개인 자료란 (JE)

  서버 커뮤니티

Profile promine 대표칭호 없음
Profile

질문하기 스크립트

스크립트 상점 관련 질문

2024.08.20 조회 수 75 추천 수 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

 

를 응용하세요