이해도 | 1.12 |
---|---|
게임버전 (JE) | 모드버킷 |
스크립트 애드온 | 2.2 dev37 |
on inventory click:
if inventory name of player's current inventory is "&6주식":
if clicked raw slot is between 10 and 16:
cancel event
loop {주식::목록::*}:
if name of clicked item contains loop-index:
if click type is left mouse button:
if {주식::목록::%loop-index%::현재갯수} >= 1:
if player has space for 1 of loop-value named loop-index:
if {money::%player%} >= {주식::목록::%loop-index%::판매가}:
subtract 1 from {주식::목록::%loop-index%::현재갯수}
subtract {주식::목록::%loop-index%::판매가} from {money::%player%}
give player 1 of loop-value named "&6%loop-index%"
message "[&6%loop-index%] 1개를 구매하셨습니다." to player
if click type is left mouse button with shift:
if {주식::목록::%loop-index%::현재갯수} >= 10:
if player has space for 10 of loop-value named loop-index:
if {money::%player%} >= {주식::목록::%loop-index%::매매가}*10:
subtract 10 from {주식::목록::%loop-index%::현재갯수}
subtract {주식::목록::%loop-index%::판매가}*10 from {money::%player%}
give player 10 of loop-value named "&6%loop-index%"
message "[&6%loop-index%] 10개를 구매하셨습니다." to player
if click type is right mouse button:
if player has 1 of loop-value named "&6%loop-index%":
add 1 to {주식::목록::%loop-index%::현재갯수}
add {주식::목록::%loop-index%::판매가} to {money::%player%}
remove 1 of loop-value named "&6%loop-index%" from player's inventory
message "[&6%loop-index%] 1개를 판매하셨습니다." to player
if click type is right mouse button with shift:
if player has 10 of loop-value named "&6%loop-index%":
add 10 to {주식::목록::%loop-index%::현재갯수}
add {주식::목록::%loop-index%::판매가}*10 to {money::%player%}
remove 10 of loop-value named "&6%loop-index%" from player's inventory
message "[&6%loop-index%] 10개를 판매하셨습니다." to player
주식스크립트 판매구문입니다. 1.14 이상버전에세는 작동을 하는데 cat서버에서는 2.2버전에서는 판매 구매구문이 먹지 않더라고요.. 바꿔야 하는 구문이 있으면 알려주시면 감사하겠습니다...
스크립터브혼
2021.06.11오류메세지 없던가요?
갱호
2021.06.11스크립터브혼
2021.06.11스크립트 69번째 줄이 오류라고합니다.
'1 of loop-value' 이런 부분이 오류입니다.
loop-value는 object 타입인데 '1 of ~'는 item 타입이 와야 합니다.
상위 버전에서는 패턴에 필요한 타입에 맞게 바꾸어 동작하게 되어있는데 낮은 버전에서는 안되나 봅니다.
갱호
2021.06.12if player has space for 1 of loop-value named loop-index:
하위버전에서 맞는 구문이 있을까요...