개인 자료란 (JE)

  서버 커뮤니티

Profile Shuro 대표칭호 없음
Profile

질문하기 스크립트

스크립트 질문

2022.11.19 조회 수 164 추천 수 0
이해도 입문자 
게임버전 (JE) 1.12.2 
게임버전 (BE) 1.12.x 

variables:

    {%player%;힘} = 0

    {%player%;모험} = 0

    {%player%;민첩} = 0

    {%player%;포인트} = 10

    

command /스텟 [<text>] [<player>] [<int>]:

    trigger:

        if arg 1 is not set:

            open chest with 3 rows named "[스텟]" to player

            set slot 4 of current inventory of player to player head named "&b&l[ &c&l스텟 &b&l] &7[스텟]" with lore "&b&l[ &c&l스텟 &b&l] &7힘: %{%player%;힘}%" and "&b&l[ &c&l스텟 &b&l] &7모험: %{%player%;모험}%" and "&b&l[ &c&l스텟 &b&l] &7민첩: %{%player%;민첩}%" and "&b&l[ &c&l스텟 &b&l] &7스텟 포인트: %{%player%;포인트}%"

            set slot 10 of current inventory of player to iron sword named "&b&l[ &c&l스텟 &b&l] &7[힘]" with lore "&b&l[ &c&l스텟 &b&l] &7힘: %{%player%;힘}%"

            set slot 13 of current inventory of player to apple named "&b&l[ &c&l스텟 &b&l] &7[모험]" with lore "&b&l[ &c&l스텟 &b&l] &7모험: %{%player%;모험}%"

            set slot 16 of current inventory of player to feather named "&b&l[ &c&l스텟 &b&l] &7[민첩]" with lore "&b&l[ &c&l스텟 &b&l] &7민첩: %{%player%;민첩}%"

        if arg 1 is "추가":

            if player is op:

                add arg 3 to {%arg 2%;포인트}

                message "[스텟] %arg 2%님에게 스텟 포인트 %arg 3% 만큼 지급하였습니다." to player

        if arg 1 is "초기화":

            if player is op:

                set {%arg 2%;힘} to 0

                set {%arg 2%;모험} to 0

                set {%arg 2%;민첩} to 0

                set {%arg 2%;포인트} to 0

                message "[스텟] %arg 2%님의 스텟을 초기화 하였습니다." to player


on inventory click:

    if inventory name of player's current inventory is "[스텟]":

        cancel event

        if click item is iron sword:

            if {%player%;포인트} > 0:

                add 1 to {%player%;힘}

                subtract 1 from {%player%;포인트}

                execute player command "/스텟"

                stop

                

on inventory click:

    if inventory name of player's current inventory is "[스텟]":

        cancel event

        if click item is apple:

            if {%player%;포인트} > 0:

                add 1 to {%player%;모험}

                subtract 1 from {%player%;포인트}

                execute player command "/스텟"

                stop


on inventory click:

    if inventory name of player's current inventory is "[스텟]":

        cancel event

        if click item is feather:

            if {%player%;포인트} > 0:

                add 1 to {%player%;민첩}

                subtract 1 from {%player%;포인트}

                execute player command "/스텟"

                stop


every 1 ticks:

    loop all players:

        set loop-player's walk speed to 0.2+{%loop-player%;민첩}*0.002


every 1 ticks:

    loop all players:

        set loop-player's max health to 10+{%loop-player%;모험}*0.7+{%loop-player%;힘}*0.4


on damage:

    add {%attacker%;힘}*1.0 to damage


on damage:

    add {%attacker%;모험}*0.25 to damage


on damage:

    add {%attacker%;민첩}*0.5 to damage


이 위에 있는 게 제가 사용할려는 스텟 스크 스립트의 구문인데 저는 이 스크립트가 마크의 레벨이 1씩 오를때 마다 스텟을 얻을 수 있게 하고 싶은데 어떻게 해야하나요?

3개의 댓글

코코냐
2022.11.19

https://docs.skunity.com/syntax/search/id:7555

단, 내려가는 경우에도 반응합니다.

Shuro
2022.11.19
@코코냐

이걸 어떻게 사용해요?

qsef1256
2022.11.20
@Shuro

이건 레벨이 올라갈 때 실행되는 이벤트 입니다. 그 밑에 스텟 변수 + 1 을 하는 구문을 적으면 되겠죠.

 

이벤트가 뭔지 모르셨다면 묻기 전에 먼저 기본적인 스크립트의 구조에 대해 알고 있으셔야 합니다.

뉴스 및 창작물
/files/thumbnails/268/789/003/262x150.crop.jpg?20240515192032

레드스톤

벌레먹은 돌 빠르게 제거하는 법

GlassesFilm

2024-05-15

0

/files/thumbnails/797/788/003/262x150.crop.jpg?20240515090924

건축

마인크래프트로 구현한 카르카손 보드게임

Warak

2024-05-15

1

/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견

학교가기싫다

2024-05-08

1

/files/thumbnails/384/778/003/262x150.crop.jpg?20240512002324

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1