개인 자료란 (JE)

  서버 커뮤니티

Profile redpanda 대표칭호 없음
Profile

질문하기 스크립트

돈이 0원일때 차감하면 -가 됩니다ㅠㅠ

2024.02.22 조회 수 20 추천 수 0
이해도 입문자 
게임버전 (JE) 1.20 
게임버전 (BE) 관련없음 



options:

    돈시스템: &a&l[&6&lMoney&a&l]&f

    설명: &b&l[&2&lMoney Help&b&l]&f

    수표: &a&l[&e&l수표&a&l]&f

    오류: &4&l[&c&l오류&4&l]&f

    

function Conversion_text(n:number) :: text:

    set {_r} to "%{_n}%"

    set {_t} to ""

    set {_itme} to length of {_r}

    set {_itme} to round up {_itme} / 3

    loop {_itme} times:

        set {_l} to the last 3 characters of {_r}

        set {_r} to the first length of {_r} - 3 characters of {_r}

        if loop-number = 1:

            set {_t} to "%{_l}%%{_t}%"

        else:

            set {_t} to "%{_l}%,%{_t}%"

    return {_t}

    

function Conversion_number(t:text) :: number:

    replace "," with "" in {_t}

    return "%{_t}%" parsed as integer


command /돈 [<text>] [<player>] [<integer>]:

    trigger:

        if arg 1 is not set:

            if player is not op:

                message "{@설명} /돈 확인"

            message "{@설명} /돈 보내기 [플레이어] [금액]"

            if player is op:

                message "&c[관리자 전용]"

                message "{@설명} /돈 확인 [플레이어]"

                message "{@설명} /돈 지급 [플레이어] [금액]"

                message "{@설명} /돈 차감 [플레이어] [금액]"

                message "{@설명} /돈 설정 [플레이어] [금액]"

                

        if arg 1 is "확인":

            if player is op:

                if arg 2 is not set:

                    message "{@돈시스템} %player%님이 가진 돈은 &e%{돈::%uuid of player%}%원 &f입니다."

                else:

                    message "{@돈시스템} %arg 2%님이 가진 돈은 &e%{돈::%uuid of arg-2%}%원 &f입니다."

            else:

                message "{@돈시스템} %player%님이 가진 돈은 &e%{돈::%uuid of player%}%원 &f입니다."

                

        if arg 1 is "보내기":

            if arg 3 >= 1:

                if {돈::%uuid of player%} >= arg 3:

                    remove arg 3 from {돈::%uuid of player%}

                    add arg 3 to {돈::%uuid of arg-2%}

                    message "{@돈시스템} %arg 2%님에게 &e%arg 3%원&f을 보냈습니다"

                else:

                    message "{@오류} 돈이 없습니다"

            else:

                message "{@오류} 1원 이상의 금액만 보내실 수 있습니다."

                

        if player is op:

            if arg 1 is "지급":

                add arg 3 to {돈::%uuid of arg-2%}

                message "{@돈시스템} %arg 2%님에게 &e%arg 3%원&f을 지급하였습니다"

                

            if arg 1 is "차감":

                remove arg 3 from {돈::%uuid of arg-2%}

                message "{@돈시스템} %arg 2%님에게 &e%arg 3%원&f을 차감하셨습니다"

                

            if arg 1 is "설정":

                set {돈::%uuid of arg-2%} to arg 3

                message "{@돈시스템} %arg 2%님의 돈을 &e%arg 3%원&f으로 설정하셨습니다"

                

        if sender is console:

            if arg 1 is "지급":

                add arg 3 to {돈::%uuid of arg-2%}

                

            if arg 1 is "차감":

                remove arg 3 from {돈::%uuid of arg-2%}

                

            if arg 1 is "설정":

                set {돈::%uuid of arg-2%} to arg 3

                message "{@돈시스템} %arg 2%님의 돈을 &e%arg 3%원&f으로 설정하셨습니다"

                

command /수표 [<integer>] [<integer>]:

    trigger:

        if arg 1 is not set:

            message "/수표 [금액] [갯수]"

        if arg 2 is not set:

            if arg 1 >= 1:

                if {돈::%uuid of player%} >= arg 1:

                    remove arg 1 from {돈::%uuid of player%}

                    give 1 of paper named "{@수표} &b%Conversion_text(arg 1)%&e원" with lore "&c우클릭시 돈이 %Conversion_text(arg 1)%원 들어옵니다." to player

                    message "{@돈시스템} &e%Conversion_text(arg 1)%&f원 만큼 &c1&f장의 수표를 만들었습니다."

                else:

                    message "{@오류} 돈이 없습니다"

            else:

                message "{@오류} 1원 이상의 금액만 뽑으실 수 있습니다."

        else:

            if arg 2 >= 1:

                if arg 1 >= 1:

                    if {돈::%uuid of player%} >= arg 1 * arg 2:

                        remove arg 1 * arg 2 from {돈::%uuid of player%}

                        give arg 2 of paper named "{@수표} &b%Conversion_text(arg 1)%&e원" with lore "&c우클릭시 돈이 %Conversion_text(arg 1)%원 들어옵니다." to player

                        message "{@돈시스템} &e%Conversion_text(arg 1)%&f원 만큼 &c%arg 2%&f장의 수표를 만들었습니다."

                    else:

                        message "{@오류} 돈이 없습니다"

                else:

                    message "{@오류} 1원 이상의 금액만 뽑으실 수 있습니다."

            else:

                message "{@오류} 1개 이상의 수표만 뽑으실 수 있습니다."

                

on rightclick with paper:

    if player's tool's name contains "{@수표}":

        set {_money} to uncolored name of player's tool

        remove 1 of player's tool from player's inventory

        replace all "수표" and " " and "[" and "]" and "원" with "" in {_money}

        add Conversion_number("%{_money}%") to {돈::%uuid of player%}

        message "{@돈시스템} &c%{_money}%&f원 만큼 돈을 얻으셨습니다." to player







이 스크립트에서 돈이 0원일때 차감하면   - 가 됩니다ㅠㅠ

수표도 3자리가 넘어가면 <none>,999 이런식으로 뜹니다ㅠㅠ


어디를 수정해야하나요?




Warning
댓글이 없습니다.

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

뉴스 및 창작물
/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

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

학교가기싫다

2024-05-08

0

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

업데이트

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

학교가기싫다

2024-05-06

0

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

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1

/files/thumbnails/576/775/003/262x150.crop.jpg?20240426232553

아티클

이달의 블록: 단단한 진흙

학교가기싫다

2024-04-26

0

/files/thumbnails/115/774/003/262x150.crop.jpg?20240428135129

업데이트

마인크래프트 1.20.5 정식 업데이트

학교가기싫다

2024-04-24

0