GoGuGuMa fbb8ea9fea0348fc9c5eb80500eb3aa6
이해도 | 중급자 |
---|---|
게임버전 (JE) | 1.18.1 |
게임버전 (BE) | 관련없음 |
스크립트 버전 | 2.6.4 |
스크립트 애드온 | valut |
아래에 코드 기재해놓겠습니다.
돈 스크립트와 기존 상점 스크립트(밸런스기능 있음)
을 통합해서 돈을 확인하고 송금하는 등의 기능을 쓰게 하고싶습니다.
가장 밑에 기재된 돈 스크립트에서 상점스크립트의 플레이어의 현재 잔고를 표시하는 방법을 모르겠습니다.
options:
말머리: &7[ &3L&bP&7 ]&f
a : &b[ &fSHOP &b]&f
s : &b[ &f수표 &b]&f
c : &1&2&3&1&r&f
c2 : &r%{shop::&::space}% %{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 {shop::point::원} to "money::\p"
on unload:
delete {shop::&::*}
delete {shop::point::*}
command /상점수표 [<text>] [<text>]:
permission: shop.point
trigger:
if arg 1 is "포인트목록":
send "&b----------[ &f포인트종류 &b]----------"
loop {shop::point::*}:
send "{@s} %loop-index% - %loop-value%"
stop
if arg 1 or arg 2 is not set:
send "&b----------[ &f수표 &b]----------"
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 "&6[수표] &f%arg-1%&f%arg-2%" with lore "" and "&7우클릭시 %arg-1% %arg-2%를 지급받습니다." to player
on rightclick with paper:
if name of event-item contains "&6[수표]": #1.17.1 if 문에서 색코드를 인식못하여 [수표] 문구로 수표라는것을 인식하게함.
set {_n} to name of event-item
replace "&6[수표] &f" with "" in {_n}
set {_point::*} to {_n} split by "&f"
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 "shop.%{_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}%}
add "", "&a[ &a구매 &a] &f- 64개&7(ShiftLeft)&f 1개&7(Left)" to lore of {_item}
loop {_lore::*}:
if "loop-index" contains "&6[수표]":
set {_l} to loop-index
replace "&6[수표] &f" with "" in {_l}
add "&7- %{_l}%" 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}%}
add "", "&b[ &b판매 &b] &f- 64개&7(ShiftRight)&f 1개&7(Right)" to lore of {_item}
loop {_lore::*}:
if "loop-index" contains "&6[수표]":
set {_l} to loop-index
replace "&6[수표] &f" with "" in {_l}
add "&7- %{_l}%" to lore of {_item}
else:
add "&7x &f%loop-value% %loop-index%" 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 oak wood floor sign 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}
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 "&6[수표]":
set {_nl} to "{%name of {_v}%}"
replace "&6[수표] &f" with "" in {_nl}
set {_price::*} to {_nl} split by "&f"
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} %name of {shop::%{_name}%::item::%{_slot}%}%을(를) %{_amount}%개 판매하였습니다." to {_p}
else:
send "{@a} %type of {shop::%{_name}%::item::%{_slot}%}%을(를) %{_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 shop.%{_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 "&6[수표]":
set {_nl} to "{%name of {_v}%}"
replace "&6[수표] &f" with "" in {_nl}
set {_price::*} to {_nl} split by "&f"
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 shop.%{_t}% 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}%} is not set:
send "{@a} 포인트가 부족해 상품을 구매할 수 없습니다." to {_p}
play sound "entity.villager.no" with volume 1 with pitch 1 to {_p}
stop
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 {shop._%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} %name of {shop::%{_name}%::item::%{_slot}%}%을(를) %{_amount}%개 구매하였습니다." to {_p}
else:
send "{@a} %type of {shop::%{_name}%::item::%{_slot}%}%을(를) %{_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>]:
aliases: shop
trigger:
if player is not op:
if arg 1 is "열기":
if arg-2 is "워프":
OpenShopDisplayItem(arg-2, "%{shop::%arg-2%::name}%{@c2}%arg-2%", player)
else if arg 2 is "커뮤니티":
OpenShopDisplayItem(arg-2, "%{shop::%arg-2%::name}%{@c2}%arg-2%", player)
else if arg 2 is "메뉴":
OpenShopDisplayItem(arg-2, "%{shop::%arg-2%::name}%{@c2}%arg-2%", player)
else:
send "{@a} 올바른 상점이름을 입력하세요."
stop
else if arg 1 or arg 2 is not set:
send "{@a} /상점 열기 <이름>"
send "{@a} 상점 : 워프, 커뮤니티, 메뉴"
stop
if arg 1 is not set:
send "&b-----[ &fShop &b]-----"
send "{@a} /상점 목록"
send "{@a} /상점 제거 <이름>"
send "{@a} /상점 생성 <이름>"
send "{@a} /상점 설정 <이름>"
send "{@a} /상점 열기 <이름>"
stop
if arg 1 is "목록":
if size of {shop::*} is 0:
send "{@a} 생성된 상점이 없습니다."
send "&b-----[ &fShop List &b]-----"
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 "&6[수표]":
set {_nl} to "%name of {_v}%"
set {_price::*} to {_nl} split by "&f"
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}":
set {_n::*} to name of event-inventory split by " {@c}- "
wait a tick
if {_n::1} contains "{@a} 커맨드설정":
if {shop::&::setcommand::%player%::*} is set:
stop
if name of player's top inventory is "Crafting": #버킷버전에 따라 name of player's top inventory의 값이 달라질수 있으니 이부분에서 오류날경우 name of player's top inventory 를 출력해본후 수정하세요.
OpenShopPrice({_n::2},{_n::3},player)
if {_n::1} 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 {_n::1} contains "{@a} 작업아이템설정":
if name of player's top inventory is "Crafting":
OpenShopSet("%{_n::2}%",player)
else if {_n::1} contains "{@a} 아이템작업설정":
if {shop::&::openshop::%player%::*} is set:
stop
if name of player's top inventory is "Crafting":
OpenShopDisplayItem({_n::2}, "{@a} 작업아이템설정 {@c}- %{_n::2}%",player)
if {_n::1} contains "{@a} 판매가격설정":
set {_name2} to "sell"
if {_n::1} 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 "Crafting":
OpenShopPrice({_n::2},{_n::3},player)
command /돈 [<string>] [<string>] [<integer>]:
trigger:
if arg 1 is not set:
send "&f"
send "&c&l * &e&lMoney System &c&l"
send "{@말머리} 보유금액: &a%{_p}'s money%"
send "{@말머리} &e&l/돈 보내기 [닉네임] [금액] &7&l- &f해당 유저 에게 돈을 보냅니다."
send "{@말머리} &e&l/돈 순위 &7&l- &f돈 순위를 확인 합니다."
send "&f"
player has permission "sk.money":
send " &b&l* &6&l관리자 명령어 &b&l*"
send "&f"
send "{@말머리} &e&l/돈 주기 [닉네임] [금액] &7&l- &f해당 유저 에게 돈을 지급합니다."
send "{@말머리} &e&l/돈 뺏기 [닉네임] [금액] &7&l- &f해당 유저 에게 돈을 뺏습니다."
send "{@말머리} &e&l/돈 설정 [닉네임] [금액] &7&l- &f해당 유저의 돈을 설정 합니다."
send "{@말머리} &e&l/돈 확인 [닉네임] &7&l- &f해당 유저의 소유 금액을 확인 합니다."
send "&f"
else if arg 1 is "보내기":
if arg 2 is not set:
send "{@말머리} 보낼 플레이어를 적어 주세요."
exit
if arg 3 is not set:
send "{@말머리} 보낼 금액을 입력해 주세요."
exit
if arg 3 > player's money:
send "{@말머리} 돈이 부족 합니다 !"
exit
if arg 3 <= 0:
send "{@말머리} 올바른 금액을 입력하세요!"
exit
execute player command "/pay %arg 2% %arg 3%"
exit
else if arg 1 is "주기":
player don't have permission "sk.money":
send "{@말머리} 권한이 없습니다."
exit
if arg 2 is not set:
send "{@말머리} 지급할 플레이어를 적어 주세요."
exit
if arg 3 is not set:
send "{@말머리} 지급할 금액을 입력해 주세요."
exit
set {_PLAYER.a} to arg 2 parsed as player
add arg 3 to money of {_PLAYER.a}
send "{@말머리} &6&l%arg 2% &e&l님에게 &a&l%arg 3%원&e&l을 지급 했습니다 !"
send "{@말머리} &c&l관리자&e&l로 부터 &a&l%arg 3%원&e&l을 지급 받았습니다 !" to {_PLAYER.a}
exit
else if arg 1 is "뺏기":
player don't have permission "sk.money":
send "{@말머리} 권한이 없습니다."
exit
if arg 2 is not set:
send "{@말머리} 뺏을 플레이어를 적어 주세요."
exit
if arg 3 is not set:
send "{@말머리} 뺏을 금액을 입력해 주세요."
exit
set {_PLAYER.a} to arg 2 parsed as player
if money of {_PLAYER.a} < arg 3:
send "{@말머리} 해당 플레이어가 충분한 금액을 가지고 있지 않습니다."
exit
subtract arg 3 from money of {_PLAYER.a}
send "{@말머리} &6&l%arg 2% &e&l님에게 &a&l%arg 3%원&e&l을 차감 시켯 습니다 !"
send "{@말머리} &c&l관리자&e&l로 부터 &a&l%arg 3%원&e&l을 빼았겼습니다 !" to {_PLAYER.a}
exit
else if arg 1 is "설정":
player don't have permission "sk.money":
send "{@말머리} 권한이 없습니다."
exit
if arg 2 is not set:
send "{@말머리} 뺏을 플레이어를 적어 주세요."
exit
if arg 3 is not set:
send "{@말머리} 뺏을 금액을 입력해 주세요."
exit
set {_PLAYER.a} to arg 2 parsed as player
set money of {_PLAYER.a} to arg 3
send "{@말머리} &6%arg 2% &e&l님의 돈을 &a&l%arg 3%원 &e&l으로 설정 했습니다 !"
exit
else if arg 1 is "순위":
execute console command "/balancetop"
exit
else if arg 1 is "확인":
player don't have permission "sk.money":
send "{@말머리} 권한이 없습니다."
exit
if arg 2 is not set:
send "{@말머리} 확인할 플레이어를 적어 주세요."
exit
set {_PLAYER.a} to arg 2 parsed as player
set {_INT.a} to money of {_PLAYER.a}
send "{@말머리} &6%arg 2% &e&l님의 보유금액: &a%{_INT.a}%"
exit
else:
send "{@말머리} 보유금액: &a%player%'s money"
exit
댓글이 없습니다.
새로운 댓글을 등록해 주세요!