D3VILH4RRT a4b5e1bfdef74b93af06cbd3c8b3f76b
이해도 | 입문자 |
---|---|
게임버전 (JE) | 1.20.1 |
게임버전 (BE) | 관련없음 |
스크립트 버전 | 2.7.2 |
상점 스크립트를 만들었는데 물건 구매 시 물건을 받고 돈이 빠져 나가게 는 했는데
판매 시 물건은 없어지는데 돈은 안들어오네요
command /상점2:
trigger:
open chest with 6 row named "&1&l상점" to player
set {_slot} to 0
loop 54 times:
set slot {_slot} of current inventory of player to black stained glass pane
add 1 to {_slot}
set slot 0 of current inventory of player to bread with lore "&b구매가격: 50원" and "&e좌클릭 구매/우클릭 판매" and "&c판매가격: 100원"
on inventory click:
if inventory name is "&1&l상점":
cancel event
if clicked item is black stained glass pane:
else:
if click type is left mouse button:
if clicked raw slot is smaller than 54:
set {_lore} to uncolored line 1 of lore of clicked item
replace all "가격":" and " " and "원" with "" in {_lore}
set {_lore} to {_lore} parsed as integer
if player's money is smaller than {_lore}:
send "&c돈이 부족합니다" to player
play sound "entity.experience_orb.pickup" with volume 0.5 and pitch 1 to the player
else:
set {_item} to clicked item
delete lore of {_item}
if player has enough space for {_item}:
give {_item} to player
subtract {_lore} from player's money
play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player
else:
send "&c&l인벤토리에 충분한 공간이 없습니다!" to player
else if click type is right mouse button:
if clicked raw slot is smaller than 54:
set {_lore} to uncolored line 3 of lore of clicked item
replace all "가격":" and " " and "원" with "" in {_lore}
set {_lore} to {_lore} parsed as integer
set {_item} to clicked item
delete lore of {_item}
if player has 1 of {_item}:
remove 1 of {_item} from player's inventory
add {_lore} to player's money
play sound "entity.experience_orb.pickup" with volume 0.5 and pitch 3 to the player
else:
send "&c현재 해당 아이템을 가지고 있지 않아 판매할 수 없습니다" to player
play sound "UI_BUTTON_CLICK" with volume 0.3 and pitch 3 to the player
댓글이 없습니다.
새로운 댓글을 등록해 주세요!