개인 자료란 (JE)

  서버 커뮤니티

Profile 데빌하트 대표칭호 없음

D3VILH4RRT a4b5e1bfdef74b93af06cbd3c8b3f76b

Profile

질문하기 스크립트

스크립트 만들다가 막혔는데 도와주세요!!

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

command /광부상점:

    trigger:

        open chest with 6 row named "&1&1광부상점" 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 10 of current inventory of player to coal with lore "&b구매가격 : 구매불가" and "&c판매가격 : 40원" and "&e좌클릭 구매/우클릭 판매"

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

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

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

        set slot 14 of current inventory of player to iron ingot with lore "&b구매가격 : 구매불가" and "&c판매가격 : 150원" and "&e좌클릭 구매/우클릭 판매"

        set slot 15 of current inventory of player to raw gold with lore "&b구매가격 : 구매불가" and "&c판매가격 : 250원" and "&e좌클릭 구매/우클릭 판매"

        set slot 16 of current inventory of player to gold ingot with lore "&b구매가격 : 구매불가" and "&c판매가격 : 300원" and "&e좌클릭 구매/우클릭 판매"

        set slot 19 of current inventory of player to lapis lazuli with lore "&b구매가격 : 구매불가" and "&c판매가격 : 120원" and "&e좌클릭 구매/우클릭 판매"

        set slot 20 of current inventory of player to diamond with lore "&b구매가격 : 구매불가" and "&c판매가격 : 3000원" and "&e좌클릭 구매/우클릭 판매"

        set slot 21 of current inventory of player to redstone with lore "&b구매가격 : 구매불가" and "&c판매가격 : 30원" and "&e좌클릭 구매/우클릭 판매"

        set slot 22 of current inventory of player to emerald with lore "&b구매가격 : 구매불가" and "&c판매가격 : 15000원" and "&e좌클릭 구매/우클릭 판매"

        set slot 23 of current inventory of player to ancient debris with lore "&b구매가격 : 구매불가" and "&c판매가격 : 2000원" and "&e좌클릭 구매/우클릭 판매"

        set slot 24 of current inventory of player to netherite ingot with lore "&b구매가격 : 구매불가" and "&c판매가격 : 10000원" and "&e좌클릭 구매/우클릭 판매"

        set slot 25 of current inventory of player to coal block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 360원" and "&e좌클릭 구매/우클릭 판매"

        set slot 28 of current inventory of player to copper block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 900원" and "&e좌클릭 구매/우클릭 판매"

        set slot 29 of current inventory of player to iron block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 1350원" and "&e좌클릭 구매/우클릭 판매"

        set slot 30 of current inventory of player to gold block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 2700원" and "&e좌클릭 구매/우클릭 판매"

        set slot 31 of current inventory of player to diamond block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 27000원" and "&e좌클릭 구매/우클릭 판매"

        set slot 32 of current inventory of player to emerald block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 135000원" and "&e좌클릭 구매/우클릭 판매"

        set slot 33 of current inventory of player to redstone block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 750원" and "&e좌클릭 구매/우클릭 판매"

        set slot 34 of current inventory of player to lapis lazuli block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 1080원" and "&e좌클릭 구매/우클릭 판매"

        set slot 38 of current inventory of player to netherite block with lore "&b구매가격 : 구매불가" and "&c판매가격 : 90000원" and "&e좌클릭 구매/우클릭 판매"

        set slot 39 of current inventory of player to quartz with lore "&b구매가격 : 구매불가" and "&c판매가격 : 30원" and "&e좌클릭 구매/우클릭 판매"

        set slot 41 of current inventory of player to iron nugget with lore "&b구매가격 : 구매불가" and "&c판매가격 : 13원" and "&e좌클릭 구매/우클릭 판매"

        set slot 42 of current inventory of player to gold nugget with lore "&b구매가격 : 구매불가" and "&c판매가격 : 33원" and "&e좌클릭 구매/우클릭 판매"

on inventory click:

    if inventory name is "&1&1광부상점":

        cancel event

        if clicked item is black stained glass pane:

        else:

            if click type is right mouse button:

                if clicked raw slot is smaller than 54:

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

                    replace all "판매가격 " and ":" 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 {%uuid of player%.돈}

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

                        if {_item} is not set:

                            set {_item} to "default_item"

                        set {_item_count} to 0

                        if {%uuid of player%.판매량::%{_item}%} is not set:

                            set {%uuid of player%.판매량::%{_item}%} to 0

                        add {_amount} to {%uuid of player%.판매량::%{_item}%}

                        set {_item_count} to {%uuid of player%.판매량::%{_item}%}

                        set {_price_change} to random integer from 5 to 10

                        set {_change_value} to 0

                        if random integer from 1 to 2 is 1:

                            set {_change_value} to {_lore} * (1 + {_price_change} / 100)  # 오름

                        else:

                            set {_change_value} to {_lore} * (1 - {_price_change} / 100)  # 내림

                        set {_item} to clicked item

                        delete lore of {_item}

                        if {_item_count} is greater than 100:

                            set {_lore} to {_lore} * 0.95

                        else if {_item_count} is less than 50:

                            set {_lore} to {_lore} * 1.1

                    else:

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

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

            if click type is right mouse button with shift:

                if clicked raw slot is smaller than 54:

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

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

                    set {_lore} to {_lore} parsed as integer

                    set {_item} to clicked item

                    delete lore of {_item}

                    set {_amount} to 1

                    if player has 64 of {_item}:

                        remove 64 of {_item} from player's inventory

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

                        set {_amount} to 64

                    else if player has 363 of {_item}:

                        remove 63 of {_item} from player's inventory

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

                        set {_amount} to 63

                    else if player has 62 of {_item}:

                        remove 62 of {_item} from player's inventory

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

                        set {_amount} to 62

                    else if player has 61 of {_item}:

                        remove 61 of {_item} from player's inventory

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

                        set {_amount} to 61

                    else if player has 60 of {_item}:

                        remove 60 of {_item} from player's inventory

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

                        set {_amount} to 60

                    else if player has 59 of {_item}:

                        remove 59 of {_item} from player's inventory

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

                        set {_amount} to 59

                    else if player has 58 of {_item}:

                        remove 58 of {_item} from player's inventory

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

                        set {_amount} to 58

                    else if player has 57 of {_item}:

                        remove 57 of {_item} from player's inventory

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

                        set {_amount} to 57

                    else if player has 56 of {_item}:

                        remove 56 of {_item} from player's inventory

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

                        set {_amount} to 56

                    else if player has 55 of {_item}:

                        remove 55 of {_item} from player's inventory

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

                        set {_amount} to 55    

                    else if player has 54 of {_item}:

                        remove 54 of {_item} from player's inventory

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

                        set {_amount} to 54

                    else if player has 53 of {_item}:

                        remove 53 of {_item} from player's inventory

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

                        set {_amount} to 53

                    else if player has 52 of {_item}:

                        remove 52 of {_item} from player's inventory

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

                        set {_amount} to 52

                    else if player has 51 of {_item}:

                        remove 51 of {_item} from player's inventory

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

                        set {_amount} to 51

                    else if player has 50 of {_item}:

                        remove 50 of {_item} from player's inventory

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

                        set {_amount} to 50

                    else if player has 49 of {_item}:

                        remove 49 of {_item} from player's inventory

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

                        set {_amount} to 49

                    else if player has 48 of {_item}:

                        remove 48 of {_item} from player's inventory

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

                        set {_amount} to 48    

                    else if player has 47 of {_item}:

                        remove 47 of {_item} from player's inventory

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

                        set {_amount} to 47

                    else if player has 46 of {_item}:

                        remove 46 of {_item} from player's inventory

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

                        set {_amount} to 46

                    else if player has 45 of {_item}:

                        remove 45 of {_item} from player's inventory

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

                        set {_amount} to 45

                    else if player has 44 of {_item}:

                        remove 44 of {_item} from player's inventory

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

                        set {_amount} to 44

                    else if player has 43 of {_item}:

                        remove 43 of {_item} from player's inventory

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

                        set {_amount} to 43

                    else if player has 42 of {_item}:

                        remove 42 of {_item} from player's inventory

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

                        set {_amount} to 42

                    else if player has 41 of {_item}:

                        remove 42 of {_item} from player's inventory

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

                        set {_amount} to 42    

                    else if player has 41 of {_item}:

                        remove 41 of {_item} from player's inventory

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

                        set {_amount} to 41

                    else if player has 40 of {_item}:

                        remove 40 of {_item} from player's inventory

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

                        set {_amount} to 40

                    else if player has 39 of {_item}:

                        remove 39 of {_item} from player's inventory

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

                        set {_amount} to 39

                    else if player has 38 of {_item}:

                        remove 38 of {_item} from player's inventory

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

                        set {_amount} to 38

                    else if player has 37 of {_item}:

                        remove 37 of {_item} from player's inventory

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

                        set {_amount} to 37

                    else if player has 36 of {_item}:

                        remove 36 of {_item} from player's inventory

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

                        set {_amount} to 36

                    else if player has 35 of {_item}:

                        remove 35 of {_item} from player's inventory

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

                        set {_amount} to 35    

                    else if player has 34 of {_item}:

                        remove 34 of {_item} from player's inventory

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

                        set {_amount} to 34

                    else if player has 33 of {_item}:

                        remove 33 of {_item} from player's inventory

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

                        set {_amount} to 33

                    else if player has 32 of {_item}:

                        remove 32 of {_item} from player's inventory

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

                        set {_amount} to 32

                    else if player has 31 of {_item}:

                        remove 31 of {_item} from player's inventory

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

                        set {_amount} to 31

                    else if player has 30 of {_item}:

                        remove 30 of {_item} from player's inventory

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

                        set {_amount} to 30

                    else if player has 29 of {_item}:

                        remove 29 of {_item} from player's inventory

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

                        set {_amount} to 29

                    else if player has 28 of {_item}:

                        remove 28 of {_item} from player's inventory

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

                        set {_amount} to 28

                    else if player has 27 of {_item}:

                        remove 27 of {_item} from player's inventory

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

                        set {_amount} to 27   

                    else if player has 26 of {_item}:

                        remove 26 of {_item} from player's inventory

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

                        set {_amount} to 26   

                    else if player has 25 of {_item}:

                        remove 25 of {_item} from player's inventory

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

                        set {_amount} to 25   

                    else if player has 24 of {_item}:

                        remove 24 of {_item} from player's inventory

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

                        set {_amount} to 24   

                    else if player has 23 of {_item}:

                        remove 23 of {_item} from player's inventory

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

                        set {_amount} to 23

                    else if player has 22 of {_item}:

                        remove 22 of {_item} from player's inventory

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

                        set {_amount} to 22   

                    else if player has 21 of {_item}:

                        remove 21 of {_item} from player's inventory

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

                        set {_amount} to 21   

                    else if player has 20 of {_item}:

                        remove 20 of {_item} from player's inventory

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

                        set {_amount} to 20   

                    else if player has 19 of {_item}:

                        remove 19 of {_item} from player's inventory

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

                        set {_amount} to 19   

                    else if player has 18 of {_item}:

                        remove 18 of {_item} from player's inventory

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

                        set {_amount} to 18   

                    else if player has 17 of {_item}:

                        remove 17 of {_item} from player's inventory

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

                        set {_amount} to 17   

                    else if player has 16 of {_item}:

                        remove 16 of {_item} from player's inventory

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

                        set {_amount} to 16   

                    else if player has 15 of {_item}:

                        remove 15 of {_item} from player's inventory

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

                        set {_amount} to 15   

                    else if player has 14 of {_item}:

                        remove 14 of {_item} from player's inventory

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

                        set {_amount} to 14 

                    else if player has 13 of {_item}:

                        remove 13 of {_item} from player's inventory

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

                        set {_amount} to 13

                    else if player has 12 of {_item}:

                        remove 12 of {_item} from player's inventory

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

                        set {_amount} to 12

                    else if player has 11 of {_item}:

                        remove 11 of {_item} from player's inventory

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

                        set {_amount} to 11

                    else if player has 10 of {_item}:

                        remove 10 of {_item} from player's inventory

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

                        set {_amount} to 10

                    else if player has 9 of {_item}:

                        remove 9 of {_item} from player's inventory

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

                        set {_amount} to 9

                    else if player has 8 of {_item}:

                        remove 8 of {_item} from player's inventory

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

                        set {_amount} to 8

                    else if player has 7 of {_item}:

                        remove 7 of {_item} from player's inventory

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

                        set {_amount} to 7

                    else if player has 6 of {_item}:

                        remove 6 of {_item} from player's inventory

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

                        set {_amount} to 6

                    else if player has 5 of {_item}:

                        remove 5 of {_item} from player's inventory

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

                        set {_amount} to 5

                    else if player has 4 of {_item}:

                        remove 4 of {_item} from player's inventory

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

                        set {_amount} to 4

                    else if player has 3 of {_item}:

                        remove 3 of {_item} from player's inventory

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

                        set {_amount} to 3

                    else if player has 2 of {_item}:

                        remove 2 of {_item} from player's inventory

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

                        set {_amount} to 2

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

                    if {_item} is not set:

                        set {_item} to "default_item"

                    set {_item_count} to 0

                    if {%uuid of player%.판매량::%{_item}%} is not set:

                        set {%uuid of player%.판매량::%{_item}%} to 0

                    add {_amount} to {%uuid of player%.판매량::%{_item}%}

                    set {_item_count} to {%uuid of player%.판매량::%{_item}%}

                    set {_price_change} to random integer from 5 to 10

                    set {_change_value} to 0

                    if random integer from 1 to 2 is 1:

                        set {_change_value} to {_lore} * (1 + {_price_change} / 100)  # 오름

                    else:

                        set {_change_value} to {_lore} * (1 - {_price_change} / 100)  # 내림

                    set {_item} to clicked item

                    delete lore of {_item}

                    if {_item_count} is greater than 100:

                        set {_lore} to {_lore} * 0.95

                    else if {_item_count} is less than 50:

                        set {_lore} to {_lore} * 1.1

                    else:

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

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

판매량에 따라 시세 변동하는 상점을 만들었는데  

변동된 시세의 판매가격이 실시간으로 나타나게 하고 싶은데 어떻게 해야하나요?




Warning
댓글이 없습니다.

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