개인 자료란 (JE)

  서버 커뮤니티

Profile 하얀눈 대표칭호 없음

Queen_SnowEyes 72d8f06e01aa4bb7b8593d879997ce8e

Profile

질문하기 스크립트

상점 스크립트 다른 돈 연동 시켜주실분

2022.06.05 조회 수 399 추천 수 0
이해도 입문자(아무것도 몰라요) 
게임버전 (JE) 1.12.2 
게임버전 (BE) 관련없음 
스크립트 버전 2.6 

options:

    a : &a[ &f상점 &a]&f

    s : &a[ &f수표 &a]&f

    c : &1&2&3&1&r&f

    c2 : &r%{shop::&::space}%   

on load: #\m = %player%'s money, \u = uuid of %player%, \p  = %player%

    set {shop::&::space} to " "

    set {shop::point::원} to "\m"

    set {shop::point::캐시} to "cash::\u"

    set {money::%uuid of player%} to \u

on unload:

    delete {shop::&::*}

    delete {shop::point::*}

    deleto {money::%uuid of player%}

command /골드:

    trigger:

        send "&f[ &e골드 &f] 소지골드 : %player's account%"

        

command /캐시:

    trigger:

        send "&f[ &e캐시 &f] 소지캐시 : %{cash::%uuid of player%}%" 

        

command /상점수표 [<text>] [<text>]:

    permission: shop.point

    trigger:

        if arg 1 is "포인트목록":

            send "&a----------[ &f포인트종류 &a]----------"

            loop {shop::point::*}:

                send "{@s} %loop-index% - %loop-value%"

            stop

        if arg 1 or arg 2 is not set:

            send "&a----------[ &f수표 &a]----------"

            send "{@s} /상점수표 <포인트> <포인트이름>"

            send "{@s} /상점수표 포인트목록"

            stop    

        if {shop::point::%arg-2%} is not set:

            send "{@a} %arg-2%는 존재하지 않는 포인트입니다."

        else if arg-1 parsed as number is not number:

            send "{@a} 포인트에는 숫자만 입력할 수 있습니다."

        else:

            give paper named "&f%arg-1%{@c}%arg-2%" with lore "" and "&7우클릭시 %arg-1% %arg-2%를 지급받습니다." to player

on rightclick with paper:

    if name of event-item contains "{@c}":

        set {_point::*} to name of event-item split by "{@c}"

        if {shop::point::%{_point::2}%} is "\m":

            add "%uncolored {_point::1}%" parsed as integer to player's money

            send "{@s} %{_point::1}%%{_point::2}%를 지급받았습니다."

        else:

            set {_t} to "%{shop::point::%{_point::2}%}%"

            replace all "\u" with "%uuid of player%" in {_t}

            replace all "\p" with "%player%" in {_t}

            add "%uncolored {_point::1}%" parsed as integer to {%{_t}%}

            send "{@s} %{_point::1}%%{_point::2}%를 지급받았습니다."

        remove 1 of event-item from player's tool    

function GetShopDisplayItem(name:text,slot:integer) :: item:

    set {_item} to {shop::%{_name}%::item::%{_slot}%}

    if size of {shop::%{_name}%::price.buy::%{_slot}%::*} is not 0:

        loop {shop::%{_name}%::price.buy::%{_slot}%::*}:

            set {_v} to loop-value

            if "%name of {_v}%" is "<none>":

                set {_n} to "%type of {_v}%"

            else:

                set {_n} to name of {_v}

            add item amount of {_v} to {_lore::%{_n}%}    

        loop {_lore::*}:

            if "%loop-index%" contains "{@c}":

                add "" to lore of {_item}

                add "&6구매 &f가격 : %loop-index%" to lore of {_item}

            else:

                add "&7x &f%loop-value% %loop-index%" to lore of {_item}

    delete {_lore::*}

    if size of {shop::%{_name}%::price.sell::%{_slot}%::*} is not 0:

        loop {shop::%{_name}%::price.sell::%{_slot}%::*}:

            set {_v} to loop-value

            if "%name of {_v}%" is "<none>":

                set {_n} to "%type of {_v}%"

            else:

                set {_n} to name of {_v}

            add item amount of {_v} to {_lore::%{_n}%}

        loop {_lore::*}:

            if "%loop-index%" contains "{@c}":

                add "&a판매 &f가격 : %loop-index%" to lore of {_item}

            else:

                add "&7x &f%loop-value% %loop-index%" to lore of {_item}

    add "" to lore of {_item}

    add "           &f< &e이용방법 &f> " to lore of {_item}

    add "" to lore of {_item}

    add "&6좌클릭          &f>         1 개 &6구매" to lore of {_item}

    add "&a우클릭          &f>         1 개 &a판매" to lore of {_item}

    add "&f쉬프트 + &6좌클릭 &f>         64 개 &6구매" to lore of {_item}

    add "&f쉬프트 + &a우클릭 &f>         전체 &a판매" to lore of {_item}                

    return {_item}

function OpenShopSet(name: text,p: player):

    set {_gui} to chest inventory with 1 rows named "{@a} 설정 {@c}- %{_name}%"

    set slot 1 of {_gui} to paper named "&a아이템 설정" with lore "", "&f클릭시 아이템설정 창으로 이동합니다.", "&f아이템 설정창에 아이템을 올려두고 GUI를 닫으면 상점에" and "&f아이템이 등록됩니다."

    set slot 3 of {_gui} to book named "&6GUI줄 설정" with lore "", "&a좌클릭시 GUI줄 크기를 증가시킵니다. ▲", "&c우클릭시 GUI줄 크기를 감소시킵니다. ▼", "&7최대값 : 6, 최소값: 1", "" and "&7현재 GUI줄 : &f%{shop::%{_name}%}%"

    set slot 5 of {_gui} to sign item named "&bGUI이름 설정" with lore "&7[ 현재이름 ]", "&f%{shop::%{_name}%::name}%", "", "&f클릭시 GUI이름 설정을 시작합니다." and "&f설정 시작시 채팅창에 GUI이름을 입력하면 설정됩니다."

    set slot 7 of {_gui} to nether star named "&e작업 설정" with lore "", "&f클릭시 작업설정 창으로 이동합니다.", "&fGUI가 열리며 작업을 설정하고싶은 아이템을 클릭하여" and "&f작업을 설정할 수 있습니다."

    open {_gui} to {_p}

function OpenShopItems(name: text,name2: text,p: player):

    set {_gui} to chest inventory with {shop::%{_name}%} row with name "{@a} %{_name2}%"

    loop {shop::%{_name}%} * 9 times:

        if {shop::%{_name}%::item::%loop-num - 1%} is set:

            set slot loop-num - 1 of {_gui} to {shop::%{_name}%::item::%loop-num - 1%}

    open {_gui} to {_p}

    

function OpenShopDisplayItem(name:text,name2:text,p:player):

    set {_gui} to chest inventory with {shop::%{_name}%} row with name "%{_name2}%"

    loop {shop::%{_name}%} * 9 times:

        if {shop::%{_name}%::item::%loop-num - 1%} is set:

            set slot loop-num - 1 of {_gui} to GetShopDisplayItem("%{_name}%","%loop-num - 1%" parsed as integer)

    open {_gui} to {_p}

    set {_1} to 35

    loop 9 times:

        add 1 to {_1}

        set slot {_1} of current inventory of {_p} to white stained glass pane named "&7"

    set {_1} to 45

    set slot {_1} of current inventory of {_p} to paper named "&f[ &a◀ &f]" with lore "&f클릭 시 &a이전 &f페이지로 이동합니다."

    set {_1} to 53

    set slot {_1} of current inventory of {_p} to paper named "&f[ &a▶ &f]" with lore "&f클릭 시 &a다음 &f페이지로 이동합니다."

    

    

function OpenShopPrice(name:text,slot:text,p:player):

    set {_gui} to chest inventory with 2 row with name "{@a} 아이템작업설정 {@c}- %{_name}% {@c}- %{_slot}%"

    set slot 1 of {_gui} to paper named "&a구매가격 설정" with lore "", "&f클릭시 구매가격 설정 창으로 이동합니다.", "&f구매가격 설정창에 아이템을 올려두고 GUI를 닫으면 해당 아이템의" and "&f구매가격이 설정됩니다."

    set slot 4 of {_gui} to paper named "&b판매가격 설정" with lore "", "&f클릭시 판매가격 설정 창으로 이동합니다.", "&f판매가격 설정창에 아이템을 올려두고 GUI를 닫으면 해당 아이템의" and "&f판매가격이 설정됩니다."

    set slot 7 of {_gui} to book named "&6구매판매 설정 설명" with lore "", "&f구매나 판매가격창에 아이템을 넣으면 가격을 아이템으로 설정할 수 있고,", "&f수표를 넣으면 가격을 포인트로 설정할 수 있습니다.", "&f예를 들어 구매가격 설정창에 1000원 수표를 넣으면" and "&f아이템의 구매비용이 1000원가 됩니다."

    set slot 10 of {_gui} to paper named "&c커맨드 설정" with lore "&f클릭시 커맨드 설정 창으로 이동합니다."

    if {shop::%{_name}%::openshop.%{_slot}%} is not set:

        set slot 13 of {_gui} to paper named "&e다른상점 열기" with lore "&7[ 현재 설정된 상점 &7]", "&f없음", "", "&f클릭시 설정을 시작합니다.", "&c쉬프트 클릭시 설정을 제거합니다.", "&f클릭후 채팅창에 이동하게할 상점의 이름을 입력하면" and "&f해당 아이템을 클릭했을때 그 상점으로 이동됩니다."

    else:    

        set slot 13 of {_gui} to paper named "&e다른상점 열기" with lore "&7[ 현재 설정된 상점 &7]", "&f%{shop::%{_name}%::openshop.%{_slot}%}%", "", "&f클릭시 설정을 시작합니다.", "&c쉬프트 클릭시 설정을 제거합니다.", "&f클릭후 채팅창에 이동하게할 상점의 이름을 입력하면" and "&f해당 아이템을 클릭했을때 그 상점으로 이동됩니다."

    open {_gui} to {_p}

function SellShopItem(name:text,slot:integer,amount:integer,p:player):

    size of {shop::%{_name}%::price.sell::%{_slot}%::*} is not 0

    set {_u} to uuid of {_p}

    set {_gui} to chest inventory with 6 row with name ""

    loop 36 times:

        set slot loop-value - 1 of {_gui} to slot loop-value - 1  of {_p}'s inventory    

    loop {_amount} times:

        add {shop::%{_name}%::price.sell::%{_slot}%::*} to {_item::*}

    remove {_amount} of {shop::%{_name}%::item::%{_slot}%} from {_gui}

    loop {_item::*}:

        set {_v} to loop-value

        if "%name of {_v}%" contains "{@c}":

            set {_nl} to "%name of {_v}%"

            set {_price::*} to {_nl} split by "{@c}"

            add "%uncolored {_price::1}%" parsed as integer to {_p::%{_price::2}%}

            remove loop-value from {_item::*}    

    add {_item::*} to {_gui}

    if size of all items in {_gui} > 36:

        send "{@a} 인벤토리 자리가 부족해 아이템을 판매할 수 없습니다." to {_p}

        play sound "entity.villager.no" with volume 1 with pitch 1 to {_p}

        stop

    else:            

        if amount of {shop::%{_name}%::item::%{_slot}%} in {_p}'s inventory >= {_amount}:

            if name of {shop::%{_name}%::item::%{_slot}%} is set:

                send "{@a} 아이템을 %{_amount}%개 판매하였습니다." to {_p}

            else:

                send "{@a} 아이템을 %{_amount}%개 판매하였습니다." to {_p}

            play sound "entity.arrow.hit_player" with volume 1 with pitch 1 to {_p}            

            remove {_amount} of {shop::%{_name}%::item::%{_slot}%} from {_p}'s inventory

            loop {_p::*}:

                if {shop::point::%loop-index%} is "\m":

                    add loop-value to {_p}'s money

                else:

                    set {_t} to "%{shop::point::%loop-index%}%"

                    replace all "\u" with "%{_u}%" in {_t}

                    replace all "\p" with "%{_p}%" in {_t}                

                    add loop-value to {%{_t}%}

            if {_item::*}     is set:

                add {_item::*} to {_p}'s inventory

        else:

            send "{@a} 아이템이 부족해 상품을 판매할 수 없습니다." to {_p}

            play sound "entity.villager.no" with volume 1 with pitch 1 to {_p}

function BuyShopItem(name:text,slot:integer,amount:integer,p:player):

    size of {shop::%{_name}%::price.buy::%{_slot}%::*} is not 0

    set {_u} to uuid of {_p}

    set {_gui} to chest inventory with 6 row with name ""

    loop 36 times:

        set slot loop-value - 1 of {_gui} to slot loop-value - 1  of {_p}'s inventory    

    loop {_amount} times:

        add {shop::%{_name}%::price.buy::%{_slot}%::*} to {_item::*}

    add {_amount} of {shop::%{_name}%::item::%{_slot}%} to {_gui}

    loop {_item::*}:

        set {_v} to loop-value

        if "%name of {_v}%" contains "{@c}":

            set {_nl} to "%name of {_v}%"

            set {_price::*} to {_nl} split by "{@c}"

            add "%uncolored {_price::1}%" parsed as integer to {_p::%{_price::2}%}

            remove loop-value from {_item::*}

        else:    

            if "%name of {_v}%" is "<none>":

                set {_n} to "%type of {_v}%"

            else:

                set {_n} to name of {_v}

            set {_%{_n}%} to {_v}    

            add item amount of {_v} to {_items::%{_n}%}

    loop {_p::*}:

        if {shop::point::%loop-index%} is "\m":

            if {_p}'s money < loop-value:

                send "{@a} 포인트가 부족해 상품을 구매할 수 없습니다." to {_p}

                play sound "entity.villager.no" with volume 1 with pitch 1 to {_p}

                stop

        else:

            set {_t} to "%{shop::point::%loop-index%}%"

            replace all "\u" with "%{_u}%" in {_t}

            replace all "\p" with "%{_p}%" in {_t}

            if {%{_t}%} < loop-value:

                send "{@a} 포인트가 부족해 상품을 구매할 수 없습니다." to {_p}

                play sound "entity.villager.no" with volume 1 with pitch 1 to {_p}

                stop        

    loop {_items::*}:

        set {_v} to {_%loop-index%}

        if amount of {_v} in {_p}'s inventory < loop-value:

            send "{@a} 아이템이 부족해 상품을 구매할 수 없습니다." to {_p}

            play sound "entity.villager.no" with volume 1 with pitch 1 to {_p}

            stop                    

        

    remove {_item::*} from {_gui}

    if size of all items in {_gui} > 36:

        send "{@a} 인벤토리 자리가 부족해 아이템을 판매할 수 없습니다." to {_p}

        play sound "entity.villager.no" with volume 1 with pitch 1 to {_p}

        stop

    else:        

        if name of {shop::%{_name}%::item::%{_slot}%} is set:

            send "{@a} 아이템을 %{_amount}%개 구매하였습니다." to {_p}

        else:

            send "{@a} 아이템을 %{_amount}%개 구매하였습니다." to {_p}

        play sound "entity.arrow.hit_player" with volume 1 with pitch 1 to {_p}            

        give {_amount} of {shop::%{_name}%::item::%{_slot}%} to {_p}

        loop {_p::*}:

            if {shop::point::%loop-index%} is "\m":

                remove loop-value from {_p}'s money

            else:

                set {_t} to "%{shop::point::%loop-index%}%"

                replace all "\u" with "%{_u}%" in {_t}

                replace all "\p" with "%{_p}%" in {_t}                

                remove loop-value from {%{_t}%}

        if {_item::*} is set:    

            remove {_item::*} from {_p}'s inventory        

function OpenCommandSet(name:text,slot:text,p:player):

    set {_gui} to chest inventory with 6 rows named "{@a} 커맨드설정 {@c}- %{_name}% {@c}- %{_slot}%"

    loop {shop::%{_name}%::command.%{_slot}%::*}:

        set {_a::*} to loop-value split by "%nl%"

        set slot "%loop-index%" parsed as integer - 1 of {_gui} to book named "&f%{_a::2}% &7[%{_a::1}%]" with lore "&f클릭시 커맨드를 수정합니다.", "&f우클릭시 권한을 변경합니다." and "&c쉬프트 클릭시 커맨드를 제거합니다."

    set slot integers from 36 and 44 of {_gui} to dark gray stained glass pane

    set slot 45 of {_gui} to player head item named "&6플레이어 커맨드 추가" with lore "&7명령어를 실행하는 플레이어의 권한의 커맨드를 추가합니다."

    set slot 46 of {_gui} to any head item named "&7오피 커맨드 추가" with lore "&7오피 권한의 커맨드를 추가합니다."

    set slot 47 of {_gui} to zombie head item named "&a콘솔 커맨드 추가" with lore "&7콘솔 권한의 커맨드를 추가합니다."

    set slot 53 of {_gui} to book named "&b설명" with lore "&f명령어 내에 '\p'를 입력하면", "&f상점에서 아이템을 클릭한 플레이어의 이름으로 변환됩니다." and "&fex) '/say \p' -> '/say Gyumy' "

    open {_gui} to {_p}

command /상점 [<text>] [<text>] [<text>]:

    permission: shop.set

    aliases: shop

    trigger:

        if arg 1 is not set:

            send "&a-----[ &f상점 &a]-----"

            send "{@a} /상점 목록"

            send "{@a} /상점 제거 <이름>"

            send "{@a} /상점 생성 <이름>"

            send "{@a} /상점 설정 <이름>"

            send "{@a} /상점 열기 <이름>"

            stop

        if arg 1 is "목록":

            if size of {shop::*} is 0:

                send "{@a} 생성된 상점이 없습니다."

            send "&a-----[ &f상점 목록 &a]-----"

            loop {shop::*}:

                send "%loop-index% - %loop-value%줄 %size of {shop::%loop-index%::item::*}%개의 아이템."

            stop

        if arg 2 is not set:

            send "{@a} 상점의 이름을 입력해주세요."

            stop

        if arg 1 is "생성":                

            if {shop::%arg-2%} is set:

                send "{@a} 이미 존재하는 상점 입니다."

                stop            

            if arg-2 contains "&":

                send "{@a} 상점이름에는 '&'을 포함할 수 없습니다."

                stop                

            send "{@a} &6%arg-2% 상점이 생성되었습니다."

            set {shop::%arg-2%} to 6

            stop

        if {shop::%arg-2%} is not set:

            send "{@a} 상점이 존재하지 않습니다."

            stop                

        if arg 1 is "열기":

            OpenShopDisplayItem(arg-2, "%{shop::%arg-2%::name}%{@c2}%arg-2%", player)

        if arg 1 is "설정":

            OpenShopSet("%arg-2%",player)

            stop    

        if arg 1 is "제거":

            delete {shop::%arg-2%::*}

            delete {shop::%arg-2%}

            send "{@a} &6%arg-2% 상점이 제거되었습니다."

on rightclick on entity:

    if uncolored name of event-entity contains "[S]":

        set {_name} to uncolored name of event-entity

        replace all "[S]" and " " with "" in {_name}

        OpenShopDisplayItem({_name}, "%{shop::%{_name}%::name}%{@c2}%{_name}%", player)

on inventory click:

    if Inventory Action is nothing:

        stop

    set {_slot} to "%index of event-slot%"    

    if name of player's top inventory contains "{@a}":

        set {_n::*} to name of player's top inventory split by " {@c}- "

        if name of player's top inventory contains "{@a} 작업아이템설정":

            cancel event 

            event-inventory is player's top inventory

            OpenShopPrice({_n::2},{_slot},player)

        else if name of player's top inventory contains "{@a} 아이템작업설정":

            cancel event

            event-inventory is player's top inventory

            if index of event-slot is 1:

                set {_gui} to chest inventory with 6 row with name "{@a} 구매가격설정 {@c}- %{_n::2}% {@c}- %{_n::3}%"

                loop {shop::%{_n::2}%::price.buy::%{_n::3}%::*}:

                    add loop-value to {_gui}

                open {_gui} to player

            else if index of event-slot is 4:

                set {_gui} to chest inventory with 6 row with name "{@a} 판매가격설정 {@c}- %{_n::2}% {@c}- %{_n::3}%"

                loop {shop::%{_n::2}%::price.sell::%{_n::3}%::*}:

                    add loop-value to {_gui}

                open {_gui} to player

            else if index of event-slot is 10:

                OpenCommandSet({_n::2},{_n::3},player)

            else if index of event-slot is 13:

                if "%click type%" contains "shift":

                    delete {shop::%{_n::2}%::openshop.%{_n::3}%}

                    OpenShopPrice({_n::2},"%{_n::3}% ",player)

                else:

                    set {shop::&::openshop::%player%::*} to {_n::2} and "%{_n::3}%"

                    send "{@a} 채팅창에 상점의 이름을 입력하세요. '&c취소&f' 를 입력하면 입력이 취소됩니다." to player

                    wait a tick

                    close player's inventory

        else if name of player's top inventory contains "{@a} 설정":

            cancel event

            event-inventory is player's top inventory

            if index of event-slot is 1:

                OpenShopItems({_n::2}, "아이템설정 {@c}- %{_n::2}%",player)

                stop

            else if index of event-slot is 3:

                if Inventory Action is pickup all:

                    if {shop::%{_n::2}%} is not 6:

                        add 1 to {shop::%{_n::2}%}

                else if Inventory Action is pickup half:

                    if {shop::%{_n::2}%} is not 1:

                        add -1 to {shop::%{_n::2}%}

                OpenShopSet({_n::2},player)

                stop

            else if index of event-slot is 5:

                send "{@a} 채탕창에 GUI의 이름을 입력하세요. '&c취소&f' 를 입력하면 입력이 취소됩니다." to player

                set {shop::&::guiname::%player%} to {_n::2}

                wait a tick

                close player's inventory

            else if index of event-slot is 7:

                OpenShopDisplayItem({_n::2}, "{@a} 작업아이템설정 {@c}- %{_n::2}%",player)

        else if name of player's top inventory contains "{@a} 커맨드설정":

            cancel event

            event-inventory is player's top inventory

            if index of event-slot is 45:

                set {shop::&::setcommand::%player%::*} to "player", {_n::2} and {_n::3}

            else if index of event-slot is 46:

                set {shop::&::setcommand::%player%::*} to "op", {_n::2} and {_n::3}

            else if index of event-slot is 47:

                set {shop::&::setcommand::%player%::*} to "console", {_n::2} and {_n::3}

            else if event-item is dark gray stained glass pane:

                stop    

            else:

                set {_a} to "%{shop::%{_n::2}%::command.%{_n::3}%::%index of event-slot + 1%}%"

                set {_a::*} to {_a} split by "%nl%"

                if click type is right mouse button:

                    if {_a::1} is "player":

                        set {shop::%{_n::2}%::command.%{_n::3}%::%index of event-slot + 1%} to "op%nl%%{_a::2}%"

                    else if {_a::1} is "op":

                        set {shop::%{_n::2}%::command.%{_n::3}%::%index of event-slot + 1%} to "console%nl%%{_a::2}%"

                    else if {_a::1} is "console":

                        set {shop::%{_n::2}%::command.%{_n::3}%::%index of event-slot + 1%} to "player%nl%%{_a::2}%"

                    set {_a} to "%{shop::%{_n::2}%::command.%{_n::3}%::%index of event-slot + 1%}%"

                    set {_a::*} to {_a} split by "%nl%"

                    send "{@a} 권한을 %{_a::1}%로 변경하였습니다."

                    OpenCommandSet({_n::2},{_n::3},player)

                    stop                

                if "%click type%" contains "shift":

                    delete {shop::%{_n::2}%::command.%{_n::3}%::%index of event-slot + 1%}

                    set {shop::%{_n::2}%::command.%{_n::3}%::*} to {shop::%{_n::2}%::command.%{_n::3}%::*}

                    send "{@a} %{_a::2}% 을(를) 제거하였습니다."

                    OpenCommandSet({_n::2},{_n::3},player)

                    stop

                else:

                    set {shop::&::setcommand::%player%::*} to {_a::1}, {_n::2}, {_n::3} and index of event-slot + 1

            if size of {shop::%{_n::2}%::command.%{_n::3}%::*} > 35:

                send "{@a} 더이상 커맨드를 추가할수 없습니다."

                delete {shop::&::setcommand::%player%::*}

                stop                

            send "{@a} &f커맨드를 입력하세요. &7(슬래쉬포함) '&c취소&f' 를 입력하면 입력이 취소됩니다." to player    

            wait a tick

            close player's inventory

    else if name of player's top inventory contains "{@c2}":

        cancel event

        event-inventory is player's top inventory

        set {_n} to name of player's top inventory

        set {_n::*} to {_n} split by "{@c2}"

        if {shop::%{_n::2}%::command.%{_slot}%::*} is set:

            loop {shop::%{_n::2}%::command.%{_slot}%::*}:

                set {_a::*} to loop-value split by "%nl%"

                replace all "\p" with "%player%" in {_a::2}

                if {_a::1} is "player":

                    execute player command "%{_a::2}%"

                else if {_a::1} is "op":

                    execute op command "%{_a::2}%"                    

                else if {_a::1} is "console":

                    execute console command "%{_a::2}%"                    

        if {shop::%{_n::2}%::openshop.%{_slot}%} is set:

            OpenShopDisplayItem({shop::%{_n::2}%::openshop.%{_slot}%}, "%{shop::%{shop::%{_n::2}%::openshop.%{_slot}%}%::name}%{@c2}%{shop::%{_n::2}%::openshop.%{_slot}%}%", player)

        if "%click type%" contains "left":

            set {_j} to 9999

            loop {shop::%{_n::2}%::price.buy::%{_slot}%::*}:

                set {_v} to loop-value

                if "%name of {_v}%" contains "{@c}":

                    set {_nl} to "%name of {_v}%"

                    set {_price::*} to {_nl} split by "{@c}"

                    add "%uncolored {_price::1}%" parsed as integer to {_p::%{_price::2}%}

                    remove loop-value from {_item::*}

                else:    

                    if "%name of {_v}%" is "<none>":

                        set {_n} to "%type of {_v}%"

                    else:

                        set {_n} to name of {_v}

                    set {_%{_n}%} to {_v}    

                    add item amount of {_v} to {_items::%{_n}%}

            loop {_p::*}:

                if {shop::point::%loop-index%} is "\m":

                    set {_t} to player's money

                else:

                    set {_t} to "%{shop::point::%loop-index%}%"

                    replace all "\u" with "%uuid of player%" in {_t}

                    replace all "\p" with "%player%" in {_t}

                    set {_t} to {%{_t}%}

                set {_i} to round down ({_t} / loop-value)

                if {_i} < {_j}:

                    set {_j} to {_i}

            loop {_items::*}:

                set {_v} to {_%loop-index%}

                set {_i} to round down (amount of {_v} in player's inventory / item amount of {_v})

                if {_i} < {_j}:

                    set {_j} to {_i}        

            if "%click type%" contains "shift":

                if {_j} is 0:

                    set {_j} to 999

                if {_j} < 64:

                    BuyShopItem({_n::2},"%{_slot}%" parsed as integer,{_j},player)

                else:

                    BuyShopItem({_n::2},"%{_slot}%" parsed as integer,64,player)

                stop

            BuyShopItem({_n::2},"%{_slot}%" parsed as integer,1,player)

        else if "%click type%" contains "right":

            if "%click type%" contains "shift":

                set {_a} to amount of {shop::%{_n::2}%::item::%{_slot}%} in player's inventory

                if {_a} is 0:

                    set {_a} to 999

                if {_a} < 64:

                    SellShopItem({_n::2},"%{_slot}%" parsed as integer,"%{_a}%" parsed as integer ,player)

                else:

                    SellShopItem({_n::2},"%{_slot}%" parsed as integer,64,player)

                stop

            SellShopItem({_n::2},"%{_slot}%" parsed as integer,1,player)

on chat:        

    if {shop::&::guiname::%player%} is set:

        if message is "취소":

            send "{@a} GUI이름설정을 &c취소&f하였습니다."

        else:

            send "{@a} 상점 %{shop::&::guiname::%player%}%의 GUI이름을 '%colored message%&f' (으)로 설정하였습니다."

            set {shop::%{shop::&::guiname::%player%}%::name} to colored message

        OpenShopSet("%{shop::&::guiname::%player%}%",player)    

        delete {shop::&::guiname::%player%}

        cancel event

    else if {shop::&::openshop::%player%::*} is set:

        if message is "취소":

            send "{@a} 설정을 &c취소&f하였습니다."

        else:

            if {shop::%message%} is set:

                send "{@a} 오픈할 상점을 '%message%&f' (으)로 설정하였습니다."

                set {shop::%{shop::&::openshop::%player%::1}%::openshop.%{shop::&::openshop::%player%::2}%} to message

            else:    

                send "{@a} %message% 은(는) 존재하지않는 상점입니다."        

        OpenShopPrice({shop::&::openshop::%player%::1},{shop::&::openshop::%player%::2},player)        

        delete {shop::&::openshop::%player%::*}

        cancel event

on command:

    if {shop::&::setcommand::%player%::*} is set:

        if full command is "취소":

            send "{@a} 설정을 &c취소&f하였습니다."

        else if {shop::&::setcommand::%player%::4} is set:

            send "{@a} 커맨드를 '/%full command%&f' (으)로 수정하였습니다."

            set {shop::%{shop::&::setcommand::%player%::2}%::command.%{shop::&::setcommand::%player%::3}%::%{shop::&::setcommand::%player%::4}%} to "%{shop::&::setcommand::%player%::1}%%nl%/%full command%"

        else:

            send "{@a} 커맨드 '/%full command%&f' (을)를 추가하였습니다."

            add "%{shop::&::setcommand::%player%::1}%%nl%/%full command%" to {shop::%{shop::&::setcommand::%player%::2}%::command.%{shop::&::setcommand::%player%::3}%::*}

        OpenCommandSet({shop::&::setcommand::%player%::2},{shop::&::setcommand::%player%::3},player)    

        delete {shop::&::setcommand::%player%::*}

        cancel event        

on inventory close:

    if name of event-inventory contains "{@a}":

        wait a tick

        set {_n::*} to name of event-inventory split by " {@c}- "

        if name of event-inventory contains "{@a} 커맨드설정":

            if {shop::&::setcommand::%player%::*} is set:

                stop

            if name of player's top inventory is "container.crafting":    

                OpenShopPrice({_n::2},{_n::3},player)        

        if name of event-inventory contains "{@a} 아이템설정":

            loop {shop::%{_n::2}%} * 9 times:

                if slot loop-num - 1 of event-inventory is air:

                    delete {shop::%{_n::2}%::item::%loop-num - 1%}

                else:

                    set {shop::%{_n::2}%::item::%loop-num - 1%} to slot loop-num - 1 of event-inventory

            send "{@a} 아이템이 설정되었습니다." to player

            OpenShopSet("%{_n::2}%",player)

        if name of event-inventory contains "{@a} 작업아이템설정":    

            if name of player's top inventory is "container.crafting":

                OpenShopSet("%{_n::2}%",player)

        else if name of event-inventory contains "{@a} 아이템작업설정":

            if {shop::&::openshop::%player%::*} is set:

                stop

            if name of player's top inventory is "container.crafting":

                OpenShopDisplayItem({_n::2}, "{@a} 작업아이템설정 {@c}- %{_n::2}%",player)

        if name of event-inventory contains "{@a} 판매가격설정":

            set {_name2} to "sell"

        if name of event-inventory contains "{@a} 구매가격설정":

            set {_name2} to "buy"

        if {_name2} is set:        

            if {_name2} is "buy":

                send "{@a} 구매가격을 설정하였습니다." to player

            else:

                send "{@a} 판매가격을 설정하였습니다." to player

            delete {shop::%{_n::2}%::price.%{_name2}%::%{_n::3}%::*}

            loop all items in event-inventory:

                add item amount of loop-value of loop-value to {shop::%{_n::2}%::price.%{_name2}%::%{_n::3}%::*}

            if size of {shop::%{_n::2}%::price.%{_name2}%::%{_n::3}%::*} is 0:

                delete {shop::%{_n::2}%::price.%{_name2}%::%{_n::3}%::*}

            if name of player's top inventory is "container.crafting":

                OpenShopPrice({_n::2},{_n::3},player)

라는 스크립트 구문에 다른 돈 스크립트를 연동 하려하는데  set {money::%uuid of player%} to \u 에서 {money::%uuid of player%} 라는 변수는 원래 이코노미 돈으로 했을때 떴던 판매: 구매: 가 안뜨고 무조건 300원이면 10000원 짜리 수표 아니고 300원 수표, 판매 눌러도 돈이아닌 수표로 들어오고 300원짜리 무언갈 구매하려하면 돈이 300원이 있거나 넘어도 수표가 없으면 구매가 안됨. 이 이유를 알려주실수 있으신분 구합니다~! 만약 아신다면 무엇을 바꿔야하는지 요약해주세요!





2개의 댓글

qsef1256
2022.06.05

일단 이미 돈 변수 였던건 전부 player's money 로 전환된 상태입니다, 둘은 같은 게 아닙니다 (player's money는 Vault 랑 연동되어서 돌아가는 겁니다)

qsef1256
2022.06.05

\m \u 같이 해 놓은 건 사실 스파게티라 각 잡고 분석해야 나옵니다, 그럴 시간은 없어서 패스하겠습니다


이거 스크립트 만든 사람을 찾아서 고치라고 하는게 제일 빠르실 껍니다

뉴스 및 창작물
/files/thumbnails/268/789/003/262x150.crop.jpg?20240515192032

레드스톤

벌레먹은 돌 빠르게 제거하는 법

GlassesFilm

2024-05-15

0

/files/thumbnails/797/788/003/262x150.crop.jpg?20240515090924

건축

마인크래프트로 구현한 카르카손 보드게임

Warak

2024-05-15

1

/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견 3

학교가기싫다

2024-05-08

1

/files/thumbnails/384/778/003/262x150.crop.jpg?20240512002324

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1