개인 자료란 (JE)

  서버 커뮤니티

Profile 하얀눈 대표칭호 없음

Queen_SnowEyes 72d8f06e01aa4bb7b8593d879997ce8e

Profile

질문하기 스크립트

돈 스크립트 에센셜 돈으로 바꿔주실분

2022.06.04 조회 수 884 추천 수 0
이해도 초보자(스크립트 구성요소나 기본문법은 알아요) 
게임버전 (JE) 1.12.2 
게임버전 (BE) 관련없음 
스크립트 버전 2.6 

#Copyright 2022. 규미(Gyumy) all rights reserved.


#[개발환경]

#Java : jre1.8.0_281 build 1.8.0_281-b09

#Bukkit : git-Paper-1618 (MC: 1.12.2)

#Skript : 2.5.3

#Add-on : x


#유튜브 : https://youtu.be/ochjDHUZ-1o

#블로그 : https://nalag.tistory.com/47

#디스코드 : 규미#7691


options:

    a: &a&l[&aMoney&a&l]&f

    b: 5000 #서버에 처음접속했을때 지급되는 기본 소지금.

function FormatKrNumUnit(n:number) :: text: #숫자를 한국식 숫자단위로 변환합니다.

    set {_t} to "%{_n}%"

    return {_t} if length of {_t} < 5

    set {_krnum::*} to "", "만", "억", "조", "경", "해" and "자"

    loop round up length of {_t} / 4 times:

        set {_l} to last 4 characters of {_t}

        loop 4 times:

            if first 1 characters of {_l} is "0":

                if loop-num-2 is 4:

                    set {_l} to ""

                else:    

                    set {_l} to last 4 - loop-num-2 characters of {_t}

            else:

                stop loop

        if {_l} is not "":        

            if {_a} is not set:

                set {_a} to "%{_l}%%{_krnum::%loop-num%}%"

            else:

                set {_a} to "%{_l}%%{_krnum::%loop-num%}% %{_a}%"        

        set {_t} to first (length of {_t} - 4) characters of {_t}

    return {_a}

function KrNumToNum(t:text) :: number:    #한국식 숫자단위를 숫자로 변환합니다.

    return {_t} parsed as integer if {_t} doesn't contain "만", "억", "조", "경", "해" or "자"

    set {_l} to ""

    loop "만", "억", "조", "경", "해" and "자":

        if {_t} contains loop-value:

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

            if {_t::2} is "":

                set {_l} to "0000%{_l}%"

            else:

                set {_l} to "%last length of {_t::2} characters of {_t}%%{_l}%"

                loop 4 - length of {_t::2} times:    

                    set {_l} to "0%{_l}%"

            replace "%loop-value%%{_t::2}%" with "" in {_t}

    return "%{_t}%%{_l}%" parsed as integer

on join:

    if {money::%uuid of player%} is not set:

        set {money::%uuid of player%} to {@b}

on rightclick with paper:

    name of tool contains "{@a} "

    cancel event

    set {_m} to uncolored name of tool

    replace "[Money]", "원 (우클릭)" and " " with "" in {_m}

    remove 1 of tool from tool

    set {_m} to KrNumToNum({_m})

    add {_m} to {money::%uuid of player%}

    play sound "block.note.bell"

    send "{@a} 수표를 소비해 &e%FormatKrNumUnit({_m})%&e원&f을 획득하였습니다. &7(소지금 : %FormatKrNumUnit({money::%uuid of player%})%&7원)" 

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

    trigger:

        if arg 1 or arg 2 is not set:

            send "{@a} &7/&f수표 [금액] [갯수] &6- &e돈을 소비하여 수표를 발행합니다."

        else if {money::%uuid of player%} + 0 < arg-1 * arg-2 :

            send "{@a} 돈이 부족해 수표를 발행 할 수 없습니다. &7(소지금 : %FormatKrNumUnit({money::%uuid of player%})%&7원)"

        else:    

            set {_i} to arg-2 of paper named "{@a} &e%FormatKrNumUnit(arg-1)%&e원 &7(우클릭)" with lore " &7우클릭시 수표가 소비되며 돈이 지급됩니다."

            if player has space for {_i}:

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

                give {_i} to player

                send "{@a} &e%FormatKrNumUnit(arg-1)%&e원 &f수표 &e%arg-2%&f장을 발행하였습니다. &7(소지금 : %FormatKrNumUnit({money::%uuid of player%})%&7원)"

            else:

                send "{@a} 인벤토리에 자리가 부족해 수표를 발행할 수 없습니다."

        

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

    trigger:                

        if arg 1 is "설정" or "주기" or "뺏기" or "초기화":

            if player is not op:

                play sound "entity.villager.no"

                send "{@a} 권한이 부족해 명령어를 실행 할 수 없습니다."

                stop

            if arg 2 is not set:

                play sound "entity.villager.no"

                send "{@a} 이름을 입력하지 않았습니다."

                stop            

            if "%arg 1% %arg-2%" is "초기화 전체":    

                delete {money::*}

                play sound "block.note.bell" to players

                broadcast "{@a} 관리자에 의해 서버의 모든 유저의 돈이 초기화되었습니다."

                stop

            set {_a::*} to offlineplayers

            loop {_a::*}:

                set {_a::%loop-index%} to "%loop-value%"

            if {_a::*} doesn't contain arg-2:

                send "{@a} &e%arg-2%&f님은 서버에 존재하지않는 플레이어입니다."

            else:

                if arg 1 is "초기화":

                    set {_p} to arg-2 parsed as offlineplayer

                    set {_u} to uuid of {_p}    

                    play sound "block.note.bell" to {_p}

                    play sound "block.note.bell"                    

                    delete {money::%{_u}%}

                    send "{@a} &e%{_p}%&f님의 돈을 초기화하였습니다."

                    send "{@a} 관리자가 &e%{_p}%&f님의 돈을 초기화하였습니다." to {_p}

                    stop        

                if arg 3 is not set:

                    play sound "entity.villager.no"

                    send "{@a} 금액을 입력하지 않았습니다."

                    stop                        

                set {_p} to arg-2 parsed as offlineplayer

                set {_u} to uuid of {_p}    

                play sound "block.note.bell" to {_p}

                play sound "block.note.bell"

                if arg 1 is "설정":

                    set {money::%{_u}%} to arg-3

                    send "{@a} 관리자가 &e%arg-2%&f님돈을 &e%FormatKrNumUnit(arg-3)%&e원&f으로 설정했습니다." to {_p}

                    send "{@a} &e%arg-2%&f님의 돈을 &e%FormatKrNumUnit(arg-3)%&e원&f으로 설정했습니다."                

                else if arg 1 is "주기":

                    add arg-3 to {money::%{_u}%}

                    send "{@a} 관리자가 &e%FormatKrNumUnit(arg-3)%&e원&f을 지급했습니다. &7(소지금 : %FormatKrNumUnit({money::%{_u}%})%&7원)" to {_p}

                    send "{@a} &e%arg-2%님에게 &e%FormatKrNumUnit(arg-3)%&e원&f을 지급했습니다. &7(소지금 : %FormatKrNumUnit({money::%{_u}%})%&7원)"

                else if arg 1 is "뺏기":    

                    remove arg-3 from {money::%{_u}%}                

                    send "{@a} 관리자가 &e%FormatKrNumUnit(arg-3)%&e원&f을 뺏었습니다. &7(소지금 : %FormatKrNumUnit({money::%{_u}%})%&7원)" to {_p}

                    send "{@a} &e%arg-2%님의 돈을 &e%FormatKrNumUnit(arg-3)%&e원&f을 뺏었습니다. &7(소지금 : %FormatKrNumUnit({money::%{_u}%})%&7원)"

        else:        

            if arg 1 is "순위":

                play sound "block.note.bell"

                loop {money::*}:

                    add loop-index to {_rank::%loop-value%::*}

                set {_index::*} to reversed indexes of {_rank::*}

                send "&6&l&m=========&6&l [ &e서버의 부자들 Top 5 &6&l] &6&l&m========="

                if {_index::*} is not set:

                    send ""

                    send "서버에 등록된 데이터가 존재하지않습니다."

                    send ""

                else:

                    loop {_index::*}:

                        loop {_rank::%loop-value-1%::*}:

                            add 1 to {_rank}

                            send " &6Top %{_rank}% &e%loop-value-2 parsed as offlineplayer% &7: &e%FormatKrNumUnit(loop-value-1 parsed as integer)%&f원"

                            stop if {_rank} is 5

                stop

            else if arg 1 is "보내기":

                if arg 2 or arg 3 is not set:

                    send "{@a} 이름 또는 금액 을 입력하지 않았습니다."

                else if arg-2 parsed as player is offline: #캐시되지않은 오프라인 플레이어를 불러올때 렉이 발생해 온라인일때만 보내지게함.

                    send "{@a} 해당 플레이어가 접속중이지 않습니다."

                else if arg 2 is player:

                    send "{@a} 자기자신에게는 돈을 보낼 수 없습니다."

                else if arg 3 <= 0:    

                    send "{@a} 보낼 금액이 0원보다 커야합니다."

                else if arg 3 > {money::%uuid of player%} + 0:

                    send "{@a} 소지금이 부족하여 돈을 보낼 수 없습니다."

                else:

                    set {_p} to arg-2 parsed as player

                    set {_u} to uuid of arg-2 parsed as player

                    remove arg-3 from {money::%uuid of player%}

                    add arg-3 to {money::%{_u}%}

                    play sound "block.note.bell"

                    play sound "block.note.bell" to {_p}

                    send "{@a} &e%arg-2%&f님에게 &e%FormatKrNumUnit(arg-3)%&e원&f을 보냈습니다. &7(소지금 : %FormatKrNumUnit({money::%{_u}%})%&7원)"

                    send "{@a} &e%player%&f님께서 &e%FormatKrNumUnit(arg-3)%&e원&f을 보냈습니다. &7(소지금 : %FormatKrNumUnit({money::%{_u}%})%&7원)" to {_p}                                

                    stop

                play sound "entity.villager.no"    

            else if arg 1 is "확인":

                if arg 2 is not set:

                    play sound "entity.villager.no"

                    send "{@a} 이름 을 입력하지 않았습니다."

                    stop                

                if arg-2 parsed as player is offline: #캐시되지않은 오프라인 플레이어를 불러올때 렉이 발생해 온라인일때만 보내지게함.

                    send "{@a} 해당 플레이어가 접속중이지 않습니다."            

                    stop

                play sound "block.note.bell"

                send ""

                send "{@a} &e%arg-2%님의 소지금 : &e%FormatKrNumUnit({money::%uuid of arg-2 parsed as player%} + 0)% 원"

                send ""    

            else:

                play sound "block.note.hat"

                send "&2&l&m=========&2&l [ &a돈 도움말 &2&l] &2&l&m========="

                send ""

                send "       &a▣ &e%player%님의 소지금 : &e%FormatKrNumUnit({money::%uuid of player%}+0)% 원"

                send ""

                send " &8/&f돈 확인 &f[이름] &6- &e다른 유저의 소지금을 확인합니다."

                send " &8/&f돈 순위 &6- &e서버내의 돈이 많은 유저들을 확인합니다."

                send " &8/&f돈 보내기 &f[이름] [금액] &6- &e다른 유저에게 돈을 보냅니다."

                player is op

                send ""

                send " &8/&f돈 설정 &f[이름] [금액] &6- &e유저의 돈을 설정합니다. &c(Op)"

                send " &8/&f돈 주기 &f[이름] [금액] &6- &e유저에게 돈을 지급합니다. &c(Op)"

                send " &8/&f돈 뺏기 &f[이름] [금액] &6- &e유저의 돈을 차감합니다. &c(Op)"

                send " &8/&f돈 초기화 &f[이름|전체] &6- &e돈 변수를 초기화합니다. &c(Op)"    

                stop        

이 스크립트를 에센셜 돈으로 바꾸는법이나. 에센셜 돈으로 바꿔주실분 구합니다! 댓글에 적어주시면 감사하겠습니다.

만약 sk 파일 수정본으로 보내주실분은 하얀눈#9856으로 보내주세용






3개의 댓글

qsef1256
2022.06.04

{money::%uuid of player%} 를 player's money 로 바꾸시구요.


loop {money::*}:
  set {_player} to loop-index parsed as offlineplayer
  set {_player}'s money to loop-value

해서 전부 이동하시면 될 것 같네요. 이거 작동하는지 테스트 안 해봤습니다, 주의해서 사용하세요

하얀눈
2022.06.04
@qsef1256

loop {money::*}:

set {_player} to loop-index parsed as offlineplayer

set {_player}'s money to loop-value 이걸 어따쓰시라는건지..

qsef1256
2022.06.04
@하얀눈

말 그대로 전부 이동 시켜주는 구문입니다, 돈 시스템 바꿨다고 해서 유저 돈 전부 날릴껀 아니잖아요

뉴스 및 창작물
/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 모드에서 악성코드 발견

학교가기싫다

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