aluir
대표칭호 없음
이해도 | 초보자 |
---|---|
게임버전 (JE) | 1.20 |
게임버전 (BE) | 관련없음 |
https://www.youtube.com/watch?v=y7hpNtYJmaw&list=PLqmOiCC6EsNPgo2-3_6mYRnW3l22DCtQB&index=20
이 영상을 보고 가챠머신 스크립트를 작성하였는데 op가 있는 유저만 가챠머신이 작동합니다
on right click on stone button with paper:
@event-item's custom model data is 777:
@@if name of player's tool contains "코인":
@@@set {_name} to uncolored name of player's tool
@@@replace all " " and "코인" with "" in {_name}
@@@if target block's location is {가챠머신::좌표::%{_name}%}:
@@@@set {_a} to size of {가챠머신::상품::%{_name}%::*}
@@@@set {_b} to random integer between 1 and {_a}
@@@@give {가챠머신::상품::%{_name}%::%{_b}%} to player
@@@@remove 1 of player's tool from player's tool
op가 없으면 이부분이 실행이 되지 않는데 왜그런거인지 알 수 있을까요?
환타비
2024.03.04해당 구문에서는 오류가 없는것 같습니다 다른 구문에서 오류가 난걸수도 있습니다
aluir
2024.03.04command /가챠머신생성 []:
trigger:
if player is op:
if player's tool is not air:
set {가챠머신::목록::%arg 1%} to 1 of player's tool
give player 1 of stick named "&d%arg 1%의 버튼설정" with lore " " and "&6[사용법]" and "&f가챠머신의 버튼 설정"
on right click on stone button with stick:
if uncolored name of player's tool contains "버튼설정":
cancel event
set {_name} to uncolored name of player's tool
replace all " " and "의" and "버튼설정" with "" in {_name}
message "%{_name}%" to player
if {가챠머신::목록::%{_name}%} is set:
set {가챠머신::좌표::%{_name}%} to target block's location
remove player's tool from player's tool
wait 1 tick
message "%{_name}%머신 버튼설정 완료!" to player
command /가챠머신관리:
trigger:
if player is op:
open chest inventory with 3 rows named "&6가챠머신목록" to player
set {_a} to 0
set {_b} to 17
loop 10 times:
set slot {_a} of current inventory of player to white stained glass pane
set slot {_b} of current inventory of player to white stained glass pane
add 1 to {_a}
add 1 to {_b}
set {_a} to 10
loop {가챠머신::목록::*}:
set slot {_a} of current inventory of player to loop-value named "&d%loop-index%" with lore "관리"
add 1 to {_a}
on inventory click:
event-inventory's name contains "&6가챠머신목록":
if index of clicked slot is between 10 and 16:
set {_아이템} to clicked slot
if {_아이템} is not air:
cancel event
set {_name} to uncolored name of clicked slot
open chest inventory with 6 rows named "%{_name}%머신 상품목록" to player
set {_a} to 0
loop {가챠머신::상품::%{_name}%::*}:
set slot {_a} of current inventory of player to loop-value
add 1 to {_a}
else:
cancel event
else:
cancel event
on inventory close:
event-inventory's name contains "상품목록":
set {_name} to event-inventory's name
replace all " " and "머신" and "상품목록" with "" in {_name}
delete {가챠머신::상품::%{_name}%::*}
set {_int} to 0
loop 54 times:
add slot {_int} of current inventory of player to {가챠머신::상품::%{_name}%::*}
add 1 to {_int}
delete {가챠슬롯물품설정.%player%}
command /가챠코인 [] []:
trigger:
if player is op:
give player arg 2 of paper with custom model data 777 named "&6%arg 1% 코인"
on right click on stone button with paper:
send "1" to player
event-item's custom model data is 777:
if name of player's tool contains "코인":
set {_name} to uncolored name of player's tool
replace all " " and "코인" with "" in {_name}
if target block's location is {가챠머신::좌표::%{_name}%}:
set {_a} to size of {가챠머신::상품::%{_name}%::*}
set {_b} to random integer between 1 and {_a}
give {가챠머신::상품::%{_name}%::%{_b}%} to player
remove 1 of player's tool from player's tool
command /가챠머신제거:
permission: op
trigger:
delete {가챠머신::*}
message "완료"
이게 전체 Skript인데 어디가 잘못됐을까요?