개인 자료란 (JE)

  서버 커뮤니티

Profile _black__white_ 대표칭호 없음
Profile

질문하기 스크립트

damage event

2021.02.12 조회 수 1599 추천 수 0
이해도 1.16 
게임버전 (JE) 페이퍼 
게임버전 (BE) skellet 
스크립트 애드온 Skript Version: 2.5.3 

on damage:
    if {%attacker%.DamageStat} is set:
        add {%attacker%.DamageStat} to damage
on damage:
    if {%victim%.DefendStat} is set:
        subtract {%victim%.DefendStat}/2 from damage
on damage:
    subtract damage from {%victim%.HealthStat}
    set {healthper} to {%victim%.HealthFullStat}/20
    set damage to 0
    set health of player to ({%victim%.HealthStat}/{healthper})/2
command /스텟:
    trigger:
        open chest with 3 rows named "&8스텟" to player
        set slot 4 of current inventory of player to player head named "[ 남은 스텟 ]" with lore "현재 남은 스텟 포인트: {%player%.statpoint}"
        set slot 11 of current inventory of player to iron sword named "[ 공격 ]" with lore "현재 스텟: {%player%.DamageStat}" and "공격력 증가폭 : 1"
        set slot 13 of current inventory of player to shield named "[ 방어 ]" with lore "현재 스텟: {%player%.DafendStat}" and "방어력 증가폭: 0.5"
        set slot 15 of current inventory of player to apple named "[ 체력 ]" with lore "현재 스텟: {%player%.HealthFullStat}" and "체력 증가폭: 1"
on inventory click:
    if name of current inventory of player is "&8스텟":
        cancel event
        if click item's name is "[ 공격 ]":
            if {%player%.statpoint} >= 1:
                add 1 to {%player%.DamageStat}
                subtract 1 from {%player%.statpoint}
                message " 성공적으로 공격 스텟 포인틀르 1 올렸습니다 "
                make player execute command "스텟"
        else if click item's name is "[ 방어 ]":
            if {%player%.statpoint} >= 1:
                add 1 to {%player%.DefendStat}
                subtract 1 from {%player%.statpoint}
                message " 성공적으로 방어 스텟 포인틀르 1 올렸습니다 "
                make player execute command "스텟"
        else if click item's name is "[ 체력 ]":
            if {%player%.statpoint} >= 1:
                add 1 to {%player%.HealthFullStat}
                add 1 to {%player%.HealthStat}
                subtract 1 from {%player%.statpoint}
                message " 성공적으로 체력 스텟 포인틀르 1 올렸습니다 "
                make player execute command "스텟"
command /스텟포인트 [<number>]:
    trigger:
        set {%player%.statpoint} to arg 1

여기서

on damage:
    subtract damage from {%victim%.HealthStat}
    set {healthper} to {%victim%.HealthFullStat}/20
    set damage to 0
    set health of player to ({%victim%.HealthStat}/{healthper})/2

요구문에  빨강색부분에서  [12:36:48 ERROR]: Use 'attacker' and/or 'victim' in damage events (스텟.sk, line 12: set health of player to ({%victim%.HealthStat}/{healthper})/2')이 오류가나요 

3개의 댓글

f7218474f6d69fac5213fe46fc772be8.PNG

 damage event에선 attacker 나 victim을 사용하라고 하네요.

csfdfa
2021.02.13

set health of player를 victim 또는 attacker 알맞게 수정해보세요

거너아나
2021.02.13

근데 {%player%.변수}도 되는군요 {변수.%player%}만 되는줄 알았는데