이해도 | 초보자 |
---|---|
게임버전 (JE) | 1.12.2 |
게임버전 (BE) | 관련없음 |
스크립트 버전 | 2.5.3 |
options:
기절소생후피: 30
기절소생범위: 2
기절시간: 15
variables:
{카운트.player} = 1000
on damage:
if victim is player:
if damage cause is not void:
if health of victim - damage <= 0:
cancel event
set victim's health to 10
if {death.list::*} contains victim:
stop
else:
play sound "BLOCK_ANVIL_PLACE" with volume 1 and pitch 1 to victim
send title "&c기절함" to victim for 3 seconds
broadcast "&c%victim%님이 기절하셨습니다."
add victim to {death.list::*}
set {카운트.player} to {@기절시간}
//------------------------------------------------------------------------------------------------------------
every 1 seconds:
if {카운트.player} < 50:
while {카운트.player} > 0:
message "%{카운트.player}%" to loop-player
if {death.list::*} contains loop-player:
if player is not sneaking:
if player is not {death.list::*}:
set loop-player's health to {카운트.player}
remove 1 from {카운트.player}
if player is {death.list::*}:
set loop-player's health to {카운트.player}
remove 1 from {카운트.player}
if player is sneaking:
if player is not {death.list::*}:
loop all players in radius {@기절소생범위} of player:
if player is sneaking:
if player is not {death.list::*}:
loop all players out radius {@기절소생범위} of player:
set loop-player's health to {카운트.player}
remove 1 from {카운트.player}
wait 1 seconds
if {death.list::*} contains loop-player:
remove loop-player from {death.list::*}
play sound "ENTITY.PLAYER.DEATH" with volume 1 and pitch 1 to loop-player
set loop-player's health to 0
set {카운트.player} to 1000
//------------------------------------------------------------------------------------------------------------
on damage:
if damage cause is not void:
if {death.list::*} contains victim:
cancel event
every 1 seconds:
apply slowness 6 without any particles to {death.list::*} for 1 seconds
apply jump boost 200 without any particles to {death.list::*} for 1 seconds
apply weakness 99 without any particles to {death.list::*} for 1 seconds
on break:
if {death.list::*} contains player:
cancel event
on sneak toggle:
loop all players in radius {@기절소생범위} of player:
if {death.list::*} contains loop-player:
if player is not loop-player:
message "&e%loop-player% &e되살리는중."
message "&e부활중." to loop-player
wait 1 seconds
if player is sneaking:
loop all players in radius {@기절소생범위} of player:
if {death.list::*} contains loop-player:
if player is not loop-player:
message "&e%loop-player% &e되살리는중.."
message "&e부활중.." to loop-player
wait 1 seconds
if player is sneaking:
loop all players in radius {@기절소생범위} of player:
if {death.list::*} contains loop-player:
if player is not loop-player:
message "&e%loop-player% &e되살리는중..."
message "&e부활중..." to loop-player
wait 1 seconds
if player is sneaking:
loop all players in radius {@기절소생범위} of player:
if {death.list::*} contains loop-player:
if player is not loop-player:
remove loop-player from {death.list::*}
broadcast "&6%player%&a님이 &6%loop-player%&a님을 되살렸습니다"
wait 1.2 seconds
set health of loop-player to {@기절소생후피}
command /revi:
trigger:
remove player from {death.list::*}
command /reviv:
trigger:
set {카운트.player} to 0
on quit:
if {death.list} contains player:
remove player from {death.list::*}
kill player
broadcast "&a%player%님께서 기절상태에서 나가셔서 죽으셨습니다."
플레이어(A)가 죽으면 기절판정(움직임,공격불가) 후 기절시간 동안 다른 플레이어(B)가 웅크리기로 살리지 않을시 죽는 스크립트입니다
기절한 동안 다른플레이어(B)가 웅크리기를 하고 있으면 죽음카운트가 멈추고 웅크리기를 안하면 카운트가 달아 죽는 시스템입니다.
죽은 플레이어는 {death.list::*}에 저장이 됩니다.
--- 수평선 부분이 문제인데 붉은색 볼드체 loop all player, loop-player 가 죽은 플레이어(A) (={death.list::*}에 저장된 플레이어) 를 지칭하는 것입니다. 그런데 스크립트에서 오류가 나더군요 해결방법이 있을까요?
코코냐
2024.01.25loop-player가 있는 루프문 바깥에 작성된 코드입니다. 코드 구조 자체가 잘못되었습니다.