djtakstar0908 475e497539874e479072ca2c27c2468d
스크립트로 강화시스템을 만들었는데요。。(오류코드 안떳습니다)
every 1 second:
loop all entities in world "world":
if loop-entity-1 is item:
set {_item1} to loop-entity-1
loop all entities in world "world":
if loop-entity-2 is item:
set {_item2} to loop-entity-2
if {_item1} is not {_item2}:
if distance between {_item1} and {_item2} is less than 0.5:
set {_i1} to item of {_item1}
set {_i2} to item of {_item2}
if {_i1} is wooden sword:
if {_i2} is diamond:
set {_level} to 0
# Check if lore exists and get the first lore length
if lore of {_i1} is set:
set {_level} to size of lore of {_i1}
# 만약 lore이 비어있다면 기본값 0을 설정
if lore of {_i1} is not set:
set {_level} to 0
if {_level} >= 10:
broadcast "&c이미 최대 강화입니다!"
delete {_item2}
stop
set {_chance} to 100 - {_level} * 10
set {_roll} to random integer between 1 and 100
if {_roll} <= {_chance}:
# 강화 성공
delete {_item1}
delete {_item2}
set {_newLevel} to {_level} + 1
set {_stars} to "★" repeated {_newLevel} times
drop 1 wooden sword named "&f+%{_newLevel}% 나무검" with lore "&e%{_stars}%" at location of {_item1}
broadcast "&a강화 성공! +%{_newLevel}%강 나무검 생성!"
else:
set {_failRoll} to random integer between 1 and 100
if {_failRoll} <= 50:
# 파괴
delete {_item1}
delete {_item2}
broadcast "&c강화 실패! 무기가 파괴되었습니다."
else:
# 하락
delete {_item1}
delete {_item2}
set {_newLevel} to {_level} - 1
if {_newLevel} < 0:
set {_newLevel} to 0
set {_stars} to "★" repeated {_newLevel} times
drop 1 wooden sword named "&f+%{_newLevel}% 나무검" with lore "&e%{_stars}%" at location of {_item1}
broadcast "&e강화 실패! 강화 수치가 감소했습니다."
위에가 코드입니다
댓글이 없습니다.
새로운 댓글을 등록해 주세요!