헬멧에 있는 로어에 크리티컬확률에 따라 헬멧 착용시 크리티컬확률이 올라가고 해제시 크리티컬확률이 내려가는걸 만들고싶은데 오류는 없는데 작동이 안됩니다.. 잘못된 부분있을까요?
if {_random} is 1:
set {_num} to random integer between 1 and 10
on armor equip:
if event-item is helmet:
if 4th line of lore of event-item contain "크리티컬":
set {_lore} to 4th line of lore of event-item
replace all "&e&l램프 효과: &e&l(공통) 크리티컬 확률 " with "" in {_lore}
replace all "%% 증가" with "" in {_lore}
set {_helmetcri} to {_lore} parsed as number
add {_helmetcri} to {criticalChance::%uuid of player%}
on armor unequip:
if event-item is helmet:
if 4th line of lore of event-item contain "크리티컬":
set {_lore} to 4th line of lore of event-item
replace all "&e&l램프 효과: &e&l(공통) 크리티컬 확률 " with "" in {_lore}
replace all "%% 증가" with "" in {_lore}
set {_helmetcri} to {_lore} parsed as number
remove {_helmetcri} from {criticalChance::%uuid of player%}
on damage:
set {_critical} to {criticalChance::%uuid of attacker%} + {_num}
if attacker's tool is sword or axe:
if 4th line of lore of attacker's tool contain "크리티컬":
set {_lore} to 4th line of lore of attacker's tool
replace all "&e&l램프 효과: &e&l(공통) 크리티컬 확률 " with "" in {_lore}
replace all "%% 증가" with "" in {_lore}
set {_num} to {_lore} parsed as number
if {_critical} > 0:
chance of {_critical}/100:
set damage to damage * 1.5
send "&c크리티컬 발동!" to attacker
play sound "ENTITY_PLAYER_ATTACK_CRIT" with volume 0.5 to the attacker