이해도 | 1.12 |
---|---|
게임버전 (JE) | 스피곳 |
스크립트 버전 | 초보자(스크립트 구성요소, 기본문법은 알아요) |
제가 교환 상점 스크립트를 만들었는데 자꾸 아이템이 빠져나가요 제가 뭐가 틀렸는지 알려주세요ㅠㅠㅠ
command /교환:
trigger:
open chest with 5 rows named "교환상점" to player
set {_crb} to 0
loop 9 times:
set slot {_crb} of current inventory of player to black stained glass pane named "&7"
add 1 to {_crb}
set slot 9 of current inventory of player to 5 leather with lore "가죽모자 1개로 교환"
set slot 10 of current inventory of player to 8 leather with lore "가죽조끼 1개로 교환"
set slot 11 of current inventory of player to 7 leather with lore "가죽바지 1개로 교환"
set slot 12 of current inventory of player to 4 leather with lore "가죽장화 1개로 교환"
set slot 14 of current inventory of player to 5 iron nugget with lore "사슬투구 1개로 교환"
set slot 15 of current inventory of player to 8 iron nugget with lore "사슬흉갑 1개로 교환"
set slot 16 of current inventory of player to 7 iron nugget with lore "사슬각반 1개로 교환"
set slot 17 of current inventory of player to 4 iron nugget with lore "사슬부츠 1개로 교환"
set slot 18 of current inventory of player to 5 gold ingot with lore "황금투구 1개로 교환"
set slot 19 of current inventory of player to 8 gold ingot with lore "황금흉갑 1개로 교환"
set slot 20 of current inventory of player to 7 gold ingot with lore "황금각반 1개로 교환"
set slot 21 of current inventory of player to 4 gold ingot with lore "황금부츠 1개로 교환"
set slot 23 of current inventory of player to 5 iron ingot with lore "철투구 1개로 교환"
set slot 24 of current inventory of player to 8 iron ingot with lore "철흉갑 1개로 교환"
set slot 25 of current inventory of player to 7 iron ingot with lore "철각반 1개로 교환"
set slot 26 of current inventory of player to 4 iron ingot with lore "철부츠 1개로 교환"
set slot 27 of current inventory of player to 5 diamond with lore "다이아몬드투구 1개로 교환"
set slot 28 of current inventory of player to 8 diamond with lore "다이아몬드흉갑 1개로 교환"
set slot 29 of current inventory of player to 7 diamond with lore "다이아몬드각반 1개로 교환"
set slot 30 of current inventory of player to 4 diamond with lore "다이아몬드부츠 1개로 교환"
on inventory click:
if inventory name is "교환 상점":
cancel event
if clicked raw slot is 9:
if player has 1 leather helmet:
remove 1 leather helmet from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 10:
if player has 1 leather chestplate:
remove 1 leather chestplate from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 11:
if player has 1 leather leggings:
remove 1 leather leggings from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 12:
if player has 1 leather boots:
remove 1 leather boots from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 14:
if player has 1 chainmail helmet:
remove 1 chainmail helmet from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 15:
if player has 1 chainmail chestplate:
remove 1 chainmail chestplate from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 16:
if player has 1 chainmail leggings:
remove 1 chainmail leggings from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 17:
if player has 1 chainmail boots:
remove 1 chainmail boots from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 18:
if player has 1 golden helmet:
remove 1 golden helmet from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 19:
if player has 1 golden chestplate:
remove 1 golden chestplate from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 20:
if player has 1 golden leggings:
remove 1 golden leggings from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 21:
if player has 1 golden boots:
remove 1 golden boots from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 23:
if player has 1 iron helmet:
remove 1 iron helmet from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 24:
if player has 1 iron chestplate:
remove 1 iron chestplate from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 25:
if player has 1 iron leggings:
remove 1 iron leggings from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 26:
if player has 1 iron boots:
remove 1 iron boots from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 27:
if player has 1 diamond helmet:
remove 1 diamond helmet from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 28:
if player has 1 diamond chestplate:
remove 1 diamond chestplate from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 29:
if player has 1 diamond leggings:
remove 1 diamond leggings from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked raw slot is 30:
if player has 1 diamond boots:
remove 1 diamond boots from player's inventory
set {_item} to clicked item
delete lore of {_item}
give {_item} to player
else:
message "&a아이템이 없습니다!"
play sound "UI_BUTTON_CLICK" with volume 0.5 to the player
stop
if clicked item is not stained glass pane:
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
거너아나
2021.07.31gui는 띄어쓰기 안했고
on inventory click에선 했고
devil1650
2021.08.01감사합니다ㅏㅏㅏㅏㅏㅏ!!!!!
스크립터브혼
2021.07.31Marlozing님 말대로 인벤토리 이름이 다르네요.
> open chest with 5 rows named "교환상점" to player
> if inventory name is "교환 상점":
띄어쓰기 때문에 그렇습니다.
devil1650
2021.08.01감사합니다ㅏㅏㅏㅏㅏㅏ!!!!!