jackoqp a392bd442f034ee6b45a6302a5010b49
이해도 | 입문자 |
---|---|
게임버전 (JE) | 1.19.4 |
게임버전 (BE) | 1.19.x |
스크립트 버전 | 2.7.0-beta3 |
스크립트 애드온 | 에드온 다 있음 |
배포되있는 강화 스크립트를 받았는데 오류가납니다
도와주세요ㅜㅜ
#!==========================================!#
#! !#
#! 아이템 강화 !#
#! !#
#!==========================================!#
# 제작: 포근한 블로그 https://zynar.tistory.com/
# 본 스크립트는 다운로드, 수정, 공유, 배포 등등 자유롭게 이용하셔도 됩니다.
# ver 1.0
#!==========================================!#
#! !#
#! npc 클릭 !#
#! !#
#!==========================================!#
on rightclick on entity:
# 무기 대장장이 오른쪽 클릭
if entity's name is "무기대장장이":
message "[무기대장장이]: 여! 무슨일이야?" to player
wait 1 seconds
message "[무기대장장이]: 미안하지만 지금은 강화밖에 할 수 없어." to player
wait 1 seconds
open chest with 1 rows named "&8&l무기 대장장이" to player
set slot 0 of current inventory of player to Anvil named "&2무기 변형" with lore "&e왼쪽 클릭시 무기 변형 창을 엽니다." and "&e일반 무기를 먼저 변형해야만 강화를 할 수 있습니다."
set slot 2 of current inventory of player to Gold Ingot named "&9무기 강화" with lore "&e왼쪽 클릭시 무기 강화 창을 엽니다."
set slot 4 of current inventory of player to Diamond named "&c무기 제련" with lore "&e왼쪽 클릭시 무기 제련 창을 엽니다."
set slot 6 of current inventory of player to Lapis Lazuli named "&a인첸트 강화" with lore "&e왼쪽 클릭시 인첸트 강화 창을 엽니다."
#!==========================================!#
#! !#
#! 강화 창 !#
#! !#
#!==========================================!#
on inventory click:
if iname contains "&8&l무기 대장장이":
if click type is left mouse button with shift or right mouse button with shift or right mouse button:
cancel event
else:
if clicked raw slot is 0:
cancel event
open chest with 1 rows named "&2&l무기 변형" to player
set {y.%player%.preInvName} to "&2&l무기 변형"
set slot 0 and 2 of current inventory of player to Stick named "&2도움말" with lore "&e막대기 사이에 무기 아이템을 둡니다."
set slot 4 of current inventory of player to Anvil named "&c무기 변형" with lore "&e왼쪽으로 누르면 무기를 변형시킵니다."
set slot 6 and 8 of current inventory of player to Stick named "&2도움말" with lore "&e막대기 사이에 변형된 아이템이 나옵니다."
if clicked raw slot is 2:
cancel event
open chest with 5 rows named "&9&l무기 강화" to player
loop 45 times:
if loop-value is not 11 or 14 or 30 or 33:
format slot loop-value - 1 of player with Stick named " " to be unstealable
set slot 11 of current inventory of player to Book named "&2도움말" with lore "&e왼쪽에 강화를 하고자 하는 무기를 둡니다."
set slot 14 of current inventory of player to Book named "&2도움말" with lore "&e왼쪽에 현재 무기보다 1단계 높은 강화석을 둡니다."
set slot 30 of current inventory of player to Book named "&2도움말" with lore "&e왼쪽에 행운석을 둡니다." and "&e행운석은 강화 확률을 올려주며 단계 하락을 방지합니다."
set slot 33 of current inventory of player to Book named "&2도움말" with lore "&e왼쪽에 파괴 방지 부적을 둡니다." and "&e파괴 방지 부적은 파괴를 방지해줍니다."
set slot 16 of current inventory of player to Anvil named "&4무기 강화" with lore "&e왼쪽 클릭시 일정확률로 강화에 성공합니다." and "&l실패시 단계 하락 및 사용불가될 수 있습니다."
if clicked raw slot is 4:
cancel event
message "[무기대장장이]: 미안 지금은 할 수 없어." to player
if clicked raw slot is 6:
cancel event
message "[무기대장장이]: 미안 지금은 할 수 없어." to player
# 무기 강화 창
if iname contains "&9&l무기 강화":
if click type is left mouse button with shift or right mouse button with shift or right mouse button:
cancel event
else:
if clicked raw slot <= 8:
cancel event
else if clicked raw slot is 9 or 11 or 12 or 14 or 15 or 17 or 18 or 19 or 20 or 21 or 22 or 23 or 24 or 25 or 26 or 27 or 28 or 30 or 31 or 33 or 34 or 35 or 36 or 37 or 38 or 39 or 40 or 41 or 42 or 43 or 44:
cancel event
else if clicked raw slot is 16:
cancel event
# 해당 변수에 slot 10에 있는 아이템의 lore을 색깔 빼고 입력
set {_아이템} to slot 10 of current inventory of player
set {_장비스탯::*} to uncolored lore of slot 10 of current inventory of player
replace all "단계" with "" in {_장비스탯::2}
replace all " " and "+" and "체력" with "" in {_장비스탯::4}
replace all " " and "+" and "공격력" with "" in {_장비스탯::5}
replace all " " and "+" and "방어력" with "" in {_장비스탯::6}
set {_강화단계} to {_장비스탯::2} parsed as number
set {_강화체력} to {_장비스탯::4} parsed as number
set {_강화공격력} to {_장비스탯::5} parsed as number
set {_강화방어력} to {_장비스탯::6} parsed as number
# 강화석 정보를 변수에 대입
set {_강화석스탯::*} to uncolored lore of slot 13 of current inventory of player
replace all " " and "단계" and "아이템을" and "강화하는데" and "쓰입니다." with "" in {_강화석스탯::1}
set {_강화석스탯} to {_강화석스탯::1} parsed as number
if {_강화단계} is not set:
message "[무기대장장이]: 먼저 아이템을 강화할 수 있도록 변형을 해야해!" to player
exit
else if {_강화단계} is not {_강화석스탯}:
message "[무기대장장이]: 어이! 강화석은 무기보다 1 높은 강화석을 써야한다구!" to player
#message "%{_강화단계}%, %{_강화석스탯::1}%"
exit
else:
set {_강화확률} to (100 - (7.2 + {_강화단계}) * {_강화단계})
chance of {_강화확률}%:
delete slot 13 of current inventory of player
set slot 10 of current inventory of player to {_아이템} with lore " " and "&b%{_강화단계} + 1%단계" and "&e==========" and "&a + 체력 %{_강화체력} + 0.5%" and "&c + 공격력 %{_강화공격력} + 1%" and "&9 + 방어력 %{_강화방어력} + 0.8%" and "&e=========="
message "[무기대장장이]: 어이! 강화에 성공했어. 잘 쓰길 바래!" to player
exit
else:
delete slot 13 of current inventory of player
message "[무기대장장이]: 으음, 강화에 실패했군. 다음엔 성공하길 바래" to player
exit
# 무기 변형 창
if iname contains "&2&l무기 변형":
if click type is left mouse button with shift or right mouse button with shift or right mouse button:
cancel event
else:
if clicked raw slot is 0 or 2 or 3 or 5 or 6 or 8:
cancel event
else if clicked raw slot is 4:
cancel event
if slot 1 of current inventory of player is air:
message "[무기대장장이]: 어이! 무기를 올려야지!" to player
else:
set {_w} to slot 1 of current inventory of player
delete slot 1 of current inventory of player
set slot 7 of current inventory of player to {_w} with lore " " and "&b0단계" and "&e==========" and "&a + 체력 0" and "&c + 공격력 0" and "&9 + 방어력 0" and "&e=========="
message "[무기대장장이]: 좋아 무기 변형에 성공했어. 창을 닫기전에 가져가!" to player
on inventory close:
if icname contains "&2&l무기 변형":
set {_무기변형1} to slot 1 of current inventory of player
set {_무기변형2} to slot 7 of current inventory of player
if {_무기변형1} is not air:
give 1 of {_무기변형1} to player
if {_무기변형2} is not air:
give 1 of {_무기변형2} to player
if icname contains "&9&l무기 강화":
set {_무기강화::1} to slot 10 of current inventory of player
set {_무기강화::2} to slot 13 of current inventory of player
set {_무기강화::3} to slot 29 of current inventory of player
set {_무기강화::4} to slot 32 of current inventory of player
if slot 10 and 13 and 29 and 32 of current inventory of player is not air:
loop {_무기강화::*}:
give 1 of loop-value to player
#!==========================================!#
#! !#
#! 커맨드 !#
#! !#
#!==========================================!#
command /강화석 [<integer>]:
trigger:
give 1 of Nether Quartz named "&6강화석 &d(%arg 1% 단계)" with lore "&b%arg 1 - 1%단계 아이템을 강화하는데 쓰입니다." to player
command /test:
trigger:
message "%{%player%.스탯.%{스탯::1}%}%"
message "%{%player%.스탯.%{스탯::2}%}%"
message "%{%player%.스탯.%{스탯::3}%}%"
#!==========================================!#
#! !#
#! 스탯 설정 !#
#! !#
#!==========================================!#
every 10 tick:
set {스탯::1} to "체력"
set {스탯::2} to "공격력"
set {스탯::3} to "방어력"
loop all players:
# 각 배열 변수에 player 장비의 lore을 대입
set {_%loop-player%.lore.1::*} to uncolored lore of loop-player's helmet
set {_%loop-player%.lore.2::*} to uncolored lore of loop-player's chestplate
set {_%loop-player%.lore.3::*} to uncolored lore of loop-player's Leggings
set {_%loop-player%.lore.4::*} to uncolored lore of loop-player's boots
set {_%loop-player%.lore.5::*} to uncolored lore of loop-player's offhand
set {_%loop-player%.lore.6::*} to uncolored lore of loop-player's tool
# 각 장비의 갯수 만큼 반복, 그리고 체력, 공격력, 방어력 3번 반복해서 숫자만 남긴 데이터를 변수에 대입
loop 6 times:
loop 3 times:
replace all " " and "+" and {스탯::%loop-value-3%} with "" in {_%loop-player%.lore.%loop-value-2%::%loop-value-3 + 3%}
set {_%loop-player%.스탯.%loop-value-2%.%{스탯::%loop-value-3%}%} to {_%loop-player%.lore.%loop-value-2%::%loop-value-3 + 3%} parsed as number
loop 3 times:
# 플레이어의 체력, 공격력, 방어력 순으로 반복함. 그리고 플레이어의 스탯을 0으로 초기화
set {%loop-player%.스탯.%{스탯::%loop-value-2%}%} to 0
# 6번 반복해서 6개의 장비 스탯을 플레이어의 스탯에 더함.
loop 6 times:
add {_%loop-player%.스탯.%loop-value-3%.%{스탯::%loop-value-2%}%} to {%loop-player%.스탯.%{스탯::%loop-value-2%}%}
set loop-player's max health to {%loop-player%.스탯.%{스탯::1}%}/2 + 10
on damage:
if attacker is player:
if {str.%attacker%} is set:
set damage to damage + {%attacker%.스탯.%{스탯::2}%}/4
set {test.%attacker%.준데미지} to damage
#message "데미지: %damage%" to attacker
if victim is player:
if {def.%victim%} is set:
set damage to damage - {%victim%.스탯.%{스탯::3}%}/4
set {test.%victim%.받은데미지} to damage
#message "받은 데미지: %damage%" to victim
on join:
if {test.%player%.준데미지} is not set:
set {test.%player%.준데미지} to 0
if {test.%player%.받은데미지} is not set:
set {test.%player%.받은데미지} to 0
IRONBLOCK
2023.08.23오류가 어떻게 떴는지 보여주세요
jackoqp
2023.08.23[02:12:30 INFO]: Line 36: (EnhanceItem.sk)
[02:12:30 INFO]: Can't understand this condition: 'iname contains "&8&l무기 대장장이"'
[02:12:30 INFO]: Line: if iname contains "&8&l무기 대장장이":
[02:12:30 INFO]: Line 72: (EnhanceItem.sk)
[02:12:30 INFO]: Can't understand this condition: 'iname contains "&9&l무기 강화"'
[02:12:30 INFO]: Line: if iname contains "&9&l무기 강화":
[02:12:30 INFO]: Line 122: (EnhanceItem.sk)
[02:12:30 INFO]: Can't understand this condition: 'iname contains "&2&l무기 변형"'
[02:12:30 INFO]: Line: if iname contains "&2&l무기 변형":
[02:12:30 INFO]: Line 139: (EnhanceItem.sk)
[02:12:30 INFO]: Can't understand this condition: 'icname contains "&2&l무기 변형"'
[02:12:30 INFO]: Line: if icname contains "&2&l무기 변형":
[02:12:30 INFO]: Line 148: (EnhanceItem.sk)
[02:12:30 INFO]: Can't understand this condition: 'icname contains "&9&l무기 강화"'
[02:12:30 INFO]: Line: if icname contains "&9&l무기 강화":
[02:12:30 INFO]: Line 212: (EnhanceItem.sk)
[02:12:30 INFO]: Use 'attacker' and/or 'victim' in damage/death events
[02:12:30 INFO]: Line: if attacker is player:
[02:12:30 INFO]: Line 218: (EnhanceItem.sk)
[02:12:30 INFO]: Use 'attacker' and/or 'victim' in damage/death events
[02:12:30 INFO]: Line: if victim is player:
이렇게 떴습니다
IRONBLOCK
2023.08.23if %name% contains "어쩌구"를 이해 못하겠다는데, 플러그인이 필요한건 아닐까요?
jackoqp
2023.08.23배포를 해준사람이 올려준거에선 플러그인이 없었습니다
환타비
2023.08.25if iname contains 이거나 if icname contains 이거나 둘다 다른 애드온이 필요한걸로 알고 있습니다
그래서 다른 구문을 알려드리겠습니다! 저기 2개 구문이 있는곳에다 if name of current inventory is로 변경을 해보세요!
그리고 밑에 if attacker is player 랑 if victim is player 이거는 is 뒤에 a 를 붙여보세요 if victim is a player 이런식으로 둘다 해보세욧!
jackoqp
2023.08.25진짜감사합니다 저것때문에 게속 찾고있었는데 덕분에 해결됬습니다ㅜㅜㅜ 감사합니다!