[Skript/Function] 판매대/상점(SellTable) 기능 공유

2021. 2. 21. 18:57·Games/Minecraft

스크립트 이름 : SellTable

스크립트 버전 : Skript 2.1.2

필요 에드온 : SkQuery

 

소개

해당 아이템에 해당 Lore가 있을경우 아래 판매대 명령어를 이용하여 아이템을 판매할 수 있습니다.

판매가격: <숫자>

를 어떠한 아이템에나 붙여주시면 <숫자> 만큼 판매대에서 판매가 가능해집니다.

 

 

※ 판매대에서는 "판매가격:" 이 없을경우 어떠한 아이템도 판매할 수 없습니다.

※ 판매대에서는 무조건 1개의 아이템씩만 판매가 가능합니다.

 

명령어/설정/노드

/판매대 - 판매대를 엽니다.

 

스크립트내에

options:

f: &2[&bSellTable&2]&f

부분을 수정하시면 prefix 수정이 가능합니다.

 

소스

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
options:
    f: &2[&bSellTable&2]&f
    
on inventory click:
    if inventory name of current inventory of player is "판매대":
        if name of click item is "&f":
            cancel event
        if name of click item is "&9판매하기":
            cancel event
            if "%slot 3 of current inventory of player%" is not "<none>":
                set {_amount} to "%slot 3 of current inventory of player%"
                set {_amount::*} to {_amount} split by " "
                if {_amount::1} parsed as integer is not set:
                    set {_lore} to lore of slot 3 of current inventory of player
                    set {_lore::*} to {_lore} split by "||"
                    loop {_lore::*}:
                        if "%loop-value%" contains "판매가격:":
                            set {_value} to uncolored loop-value
                            replace all "판매가격: " with "" in {_value}
                            set {_value} to {_value} parsed as integer
                            add {_value} to player's money
                            if "%name of slot 3 of current inventory of player%" is "<none>":
                                message "{@f} %type of slot 3 of current inventory of player%&f을 팔아 &a%{_value}%&f원을 얻었습니다!"
                            else:
                                message "{@f} %name of slot 3 of current inventory of player%&f을 팔아 &a%{_value}%&f원을 얻었습니다!"
                            set slot 3 of current inventory of player to air
                            stop
                    message "{@f} &c이것은 판매할 수 없습니다!"
                else:
                    message "{@f} &c1개씩만 올려주세요!"
            else:
                message "{@f} &c칸 안에 올려주세요!"
        if name of click item is "&f판매대 나가기":
            cancel event
            close player's inventory
 
command /판매대:
    trigger:
        open chest with 1 row named "판매대" to player
        loop 9 times:
            set slot (loop-number)-1 of current inventory of player to glass pane named "&f"
        set slot 3 of current inventory of player to air
        set slot 5 of current inventory of player to flower pot item named "&9판매하기"
        set slot 8 of current inventory of player to wooden door item named "&f판매대 나가기"
Colored by Color Scripter
cs
반응형
저작자표시 비영리 (새창열림)
'Games/Minecraft' 카테고리의 다른 글
  • [CommandHelper/Function] AutoQuiz(자동 퀴즈) 기능
  • [CommandHelper/Function] 플레이어가 죽었을 때 특정 아이템을 떨구는 기능
  • [CommandHelper/Function] 특정 거리안의 플레이어 찾기
  • [Skript/Function] 그룹(Group) 기능 공유
Kua
Kua
정보 공유, 개인 정리 공간 입니다.
  • Kua
    Kua's Miscellaneous
    Kua
    • 분류 전체보기 (185)
      • 대문 (2)
      • Tips (25)
        • Chrome (2)
        • Windows (4)
        • IDE (3)
        • 기타 (16)
      • CodingTest (44)
      • Language (20)
        • PHP (5)
        • C# (7)
        • Java (1)
        • Kotlin (7)
      • Framework & Runtime (16)
        • SpringBoot (12)
        • Node.js (2)
        • Vue.js (1)
        • Gradle (1)
      • DevOps (13)
        • Linux (1)
        • Docker (4)
        • Kubernetes (2)
        • Apache Kafka (1)
        • AWS (1)
      • 일상다반사 (53)
        • 도서 (1)
        • 개발 (8)
        • 후기 - IT (7)
        • 후기 - 일상 (13)
        • 차가리 (4)
        • 방송통신대학교 (4)
        • 음식 (2)
      • Games (12)
        • Minecraft (7)
        • VR (2)
        • 그외 (3)
  • 최근 글

  • 인기 글

  • 태그

    갤럭시
    minecraft
    c#
    Algorithm
    bronze1
    Kotlin
    Windows
    error
    Spring Boot
    코딩테스트
    Plugin
    bronze2
    codingtest
    알고리즘
    후기
    Silver5
    java
    spring
    백준
    github
  • 전체
    오늘
    어제
  • hELLO· Designed By정상우.v4.10.0
Kua
[Skript/Function] 판매대/상점(SellTable) 기능 공유
상단으로

티스토리툴바