개인 자료란 (JE)

  서버 커뮤니티

Profile promine 대표칭호 없음
Profile

질문하기 스크립트

스크립트 상점 관련 질문

27 일 전 조회 수 59 추천 수 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
26 일 전

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/677/856/003/262x150.crop.jpg?20240913205849

아티클

마인크래프트 개발의 미래

학교가기싫다

2024-09-13

1

사진이 없습니다.

모드

아이리스 쉐이더

gyeol12

2024-09-07

0

/files/thumbnails/382/873/003/262x150.crop.jpg?20240903125347

레드스톤

[노트블럭커버] 숙청행진 - 밀그램

노트블럭전문가

2024-09-03

0

/files/thumbnails/069/864/003/262x150.crop.jpg?20240819102737

레드스톤

[노트블럭커버] 만찬가 - tuki

노트블럭전문가

2024-08-19

1

/files/thumbnails/647/816/003/262x150.crop.jpg?20240619112336

건축

숭례문(프리퀄) 4

KHC

2024-06-19

0