이해도 | 초보자 |
---|---|
게임버전 (JE) | 관련없음 |
게임버전 (BE) | 관련없음 |
스크립트 버전 | 2.9.1 |
스크립트 애드온 | Skellet, SkQuery, skRayFall |
options:
@ : &f[&6유저상점&f]
command /유저상점 [<text>] [<integer>]:
trigger:
arg 1 isn't set:
message "{@@} &f/유저상점 열기"
message "{@@} &f/유저상점 등록 [가격]"
player is op:
message "{@@} &c/유저상점 초기화"
arg 1 is "열기":
open chest with 6 rows named "{@@}" to player
loop 54 times:
set slot loop-num - 1 of player's current inventory to {유저상점::%loop-number%}
arg 1 is "등록":
arg 2 isn't set:
message "{@@} &c가격을 입력해주세요"
tool is air:
message "{@@} &c등록할 아이템을 손에 들어주세요"
stop
arg 2 <= 0:
message "{@@} &c가격은 양수로만 지정가능합니다"
arg 2 > 0:
set {_i} to tool
add "&c판매가격 : %arg 2% - %player%" to {_i}'s lore
add {_i} to {유저상점::*}
set tool to air
message "{@@} &f손에 든 아이템이 %arg 2%&f원에 등록되었습니다"
arg 1 is "초기화":
delete {유저상점::*}
message "{@@} &c유저상점이 초기화되었습니다"
on inventory click:
player's current inventory's name is "{@@}":
cancel event
clicked slot isn't air:
loop clicked slot's lore:
loop-value contains "&c판매가격":
set {_i} to clicked slot
add loop-value split at " " to {_s::*}
set {_p} to {_s::3} parsed as integer
player's money >= {_p}:
set {_size} to size of {유저상점::*}
loop 20 times:
loop-value-1 is line loop-num-2 of {_i}'s lore:
delete line loop-num-2 of {_i}'s lore
give {_i} to player
remove {_p} from player's money
set {_player} to {_s::5} parsed as player
add {_p} to {_player}'s money
send "{@@} &a당신이 올린 아이템이 판매되여 %{_p}%원을 얻었습니다" to {_player}
message "{@@} &f아이템을 성공적으로 구매했습니다"
loop {유저상점::*}:
loop-value-2 is clicked slot:
set {_n} to loop-index parsed as integer
set {_loop} to size of {유저상점::*} - {_n}
loop {_loop} times:
set {_n+1} to {_n} + 1
set {유저상점::%{_n}%} to {유저상점::%{_n+1}%}
add 1 to {_n}
delete {유저상점::%{_size}%}
execute player command "/유저상점 열기"
stop
player's money >= {_p}: 이 부분이 틀렸다고 하는데.. 잘 모르겠어요
windy_wind
2024.08.15player's money 는 vault 플러그인 있어야합니다
ice1465
2024.08.15있어요!
windy_wind
2024.08.16흠.. player's money 값이 숫자값 아닌가요 그럴 될텐딩
오류난 부분을 스샷찍어 주실래요?
ice1465
2024.08.17아 다른 스크립트랑 변수가 달라서 그랬네요 해결했습니다!