개인 자료란 (JE)

  서버 커뮤니티

Profile gyeol2008 대표칭호 없음
Profile

질문하기 스크립트

서버를 껏다키면 스크립트 변수가 초기화 되는데 어떻게 해결하나요?

2024.06.17 조회 수 63 추천 수 0
이해도 입문자 
게임버전 (JE) 관련없음, 1.19.4 
게임버전 (BE) 관련없음 
스크립트 버전 1.19.4 
스크립트 애드온 모름 

#-------스텟----------

options:

    s:&l&7[SYSTEM]&r&R


on join:

    if {attack.%uuid of player%} is not set:

        set {attack.%uuid of player%} to 1

    if {protect.%uuid of player%} is not set:

        set {protect.%uuid of player%} to 1

    if {health.%uuid of player%} is not set:

        set {health.%uuid of player%} to 1

    if {statpoint.%uuid of player%} is not set:

        set {statpoint.%uuid of player%} to 0


command /stat:

    trigger:

        execute player command "/스텟"


command /tmxpt:

    trigger:

        execute player command "/스텟"


command /스텟 [<text>] [<offline player>] [<integer>]:

    trigger:

        if arg-1 is not set:

            set {_slot} to 0

            open chest inventory with 1 rows named "&6스텟" to player

            loop 10 times:

                set slot {_slot} of current inventory of player to black stained glass pane named "&7"

                add 1 to {_slot}

            set slot 2 of current inventory of player to diamond sword named "&c공격 스텟"

            add "&f현재 공격스텟: %{attack.%uuid of player%}%" to lore of slot 2 of current inventory of player

            add " " to lore of slot 2 of current inventory of player

            add "&b1스텟당 공격력이 일정량 증가합니다." to lore of slot 2 of current inventory of player

            add "&e가진 스텟포인트: %{statpoint.%uuid of player%}%" to lore of slot 2 of current inventory of player

            if {attack.%uuid of player%} >= 0:

                if {attack.%uuid of player%} <= 9:

                    add "&2필요 스텟포인트: 1" to lore of slot 2 of current inventory of player

                    add " " to lore of slot 2 of current inventory of player

                    add "&e☆☆☆" to lore of slot 2 of current inventory of player

                if {attack.%uuid of player%} >= 10:

                    if {attack.%uuid of player%} <= 19:

                        add "&2필요 스텟포인트: 2" to lore of slot 2 of current inventory of player

                        add " " to lore of slot 2 of current inventory of player

                        add "&e★☆☆" to lore of slot 2 of current inventory of player

                if {attack.%uuid of player%} >= 20:

                    if {attack.%uuid of player%} <= 29:

                        add "&2필요 스텟포인트: 3" to lore of slot 2 of current inventory of player

                        add " " to lore of slot 2 of current inventory of player

                        add "&e★★☆" to lore of slot 2 of current inventory of player

                if {attack.%uuid of player%} is 30:

                    add "&2최고치 달성" to lore of slot 2 of current inventory of player

                    add " " to lore of slot 2 of current inventory of player

                    add "&e★★★" to lore of slot 2 of current inventory of player


        

            set slot 4 of current inventory of player to totem of undying named "&6체력 스텟"

            add "&f현재 체력스텟: %{health.%uuid of player%}%" to lore of slot 4 of current inventory of player

            add " " to lore of slot 4 of current inventory of player

            add "&b1스텟당 체력이 2 증가합니다." to lore of slot 4 of current inventory of player

            add "&e가진 스텟포인트: %{statpoint.%uuid of player%}%" to lore of slot 4 of current inventory of player

            if {health.%uuid of player%} >= 0:

                if {health.%uuid of player%} <= 9:

                    add "&2필요 스텟포인트: 1" to lore of slot 4 of current inventory of player

                    add " " to lore of slot 4 of current inventory of player

                    add "&e☆☆☆" to lore of slot 4 of current inventory of player

                if {health.%uuid of player%} >= 10:

                    if {health.%uuid of player%} <= 19:

                        add "&2필요 스텟포인트: 2" to lore of slot 4 of current inventory of player

                        add " " to lore of slot 4 of current inventory of player

                        add "&e★☆☆" to lore of slot 4 of current inventory of player

                if {health.%uuid of player%} >= 20:

                    if {health.%uuid of player%} <= 29:

                        add "&2필요 스텟포인트: 3" to lore of slot 4 of current inventory of player

                        add " " to lore of slot 4 of current inventory of player

                        add "&e★★☆" to lore of slot 4 of current inventory of player

                if {health.%uuid of player%} is 30:

                    add "&2최고치 달성" to lore of slot 4 of current inventory of player

                    add " " to lore of slot 4 of current inventory of player

                    add "&e★★★" to lore of slot 4 of current inventory of player

        

            set slot 6 of current inventory of player to diamond chestplate named "&3방어력 스텟"

            add "&f현재 방어력스텟: %{protect.%uuid of player%}%" to lore of slot 6 of current inventory of player

            add " " to lore of slot 6 of current inventory of player

            add "&b1스텟당 방어력이 일정량 증가합니다." to lore of slot 6 of current inventory of player

            add "&e가진 스텟포인트: %{statpoint.%uuid of player%}%" to lore of slot 6 of current inventory of player    

            if {protect.%uuid of player%} >= 0:

                if {protect.%uuid of player%} <= 9:

                    add "&2필요 스텟포인트: 1" to lore of slot 6 of current inventory of player

                    add " " to lore of slot 6 of current inventory of player

                    add "&e☆☆☆" to lore of slot 6 of current inventory of player

                if {protect.%uuid of player%} >= 10:

                    if {protect.%uuid of player%} <= 19:

                        add "&2필요 스텟포인트: 2" to lore of slot 6 of current inventory of player

                        add " " to lore of slot 6 of current inventory of player

                        add "&e★☆☆" to lore of slot 6 of current inventory of player

                if {protect.%uuid of player%} >= 20:

                    if {protect.%uuid of player%} <= 29:

                        add "&2필요 스텟포인트: 3" to lore of slot 6 of current inventory of player

                        add " " to lore of slot 6 of current inventory of player

                        add "&e★★☆" to lore of slot 6 of current inventory of player

                if {protect.%uuid of player%} is 30:

                    add "&2최고치 달성" to lore of slot 6 of current inventory of player

                    add " " to lore of slot 6 of current inventory of player

                    add "&e★★★" to lore of slot 6 of current inventory of player


            set slot 8 of current inventory of player to barrier named "&c스텟 초기화"

            add "&c클릭시 스텟이 초기화 되며 일정량만이 환불됩니다." to lore of slot 8 of current inventory of player


        if arg-1 is "초기화":

            add {attack.%uuid of player%}+{health.%uuid of player%}+{protect.%uuid of player%}-3 to {statpoint.%uuid of player%}

            set {attack.%uuid of player%} to 1

            set {health.%uuid of player%} to 1

            set {protect.%uuid of player%} to 1

            send "&a스텟이 초기화 되었습니다!"

            set player's max health to 10+{health.%uuid of player%}-1


        if arg-1 is "설정":

            if player has permission "stat.set":

                if arg-2 is set:

                    if arg-3 is set:

                        set {statpoint.%uuid of arg-2%} to arg-3

                        send "&2성공적으로 %arg-2%의 스텟포인트를 %arg-3%로 설정했습니다!" to player

                        send "&2%player%님이 당신의 스텟포인트를 %arg-3%로 설정했습니다!" to arg-2


on inventory click:

    if name of event-inventory is "&6스텟":

        cancel event

        play sound "UI_BUTTON_CLICK" with volume 0.5 to the player

        if clicked slot is (2):

            if {attack.%uuid of player%} >= 0:

                if {attack.%uuid of player%} <= 9:

                    if {statpoint.%uuid of player%} = 1:

                        subtract 1 from {statpoint.%uuid of player%}

                        add 1 to {attack.%uuid of player%}

                        execute player command "/스텟"

                        send "&a공격력이 올랐습니다!" to player

                        stop

                    if {statpoint.%uuid of player%} >= 1:

                        subtract 1 from {statpoint.%uuid of player%}

                        add 1 to {attack.%uuid of player%}

                        execute player command "/스텟"

                        send "&a공격력이 올랐습니다!" to player

                        stop

            if {attack.%uuid of player%} >= 10:

                if {attack.%uuid of player%} <= 19:

                    if {statpoint.%uuid of player%} = 2:

                        subtract 2 from {statpoint.%uuid of player%}

                        add 1 to {attack.%uuid of player%}

                        execute player command "/스텟"

                        send "&a공격력이 올랐습니다!" to player

                        stop

                    if {statpoint.%uuid of player%} >= 2:

                        subtract 2 from {statpoint.%uuid of player%}

                        add 1 to {attack.%uuid of player%}

                        execute player command "/스텟"

                        send "&a공격력이 올랐습니다!" to player

                        stop

            if {attack.%uuid of player%} >= 20:

                if {attack.%uuid of player%} <= 29:

                    if {statpoint.%uuid of player%} = 3:

                        subtract 3 from {statpoint.%uuid of player%}

                        add 1 to {attack.%uuid of player%}

                        execute player command "/스텟"

                        send "&a공격력이 올랐습니다!" to player

                        stop

                    if {statpoint.%uuid of player%} >= 3:

                        subtract 3 from {statpoint.%uuid of player%}

                        add 1 to {attack.%uuid of player%}

                        execute player command "/스텟"

                        send "&a공격력이 올랐습니다!" to player

                        stop

            if {attack.%uuid of player%} is 30:

                send "&c%uuid of player%님은 이미 [공격] 스텟에 대해 최고치를 달성하셨습니다." to player

                stop



        if clicked slot is (4):

            if {health.%uuid of player%} >= 0:

                if {health.%uuid of player%} <= 9:

                    if {statpoint.%uuid of player%} = 1:

                        subtract 1 from {statpoint.%uuid of player%}

                        add 1 to {health.%uuid of player%}

                        execute player command "/스텟"

                        send "&a체력이 올랐습니다!" to player

                        set player's max health to 10+{health.%uuid of player%}

                        stop

                    if {statpoint.%uuid of player%} >= 1:

                        subtract 1 from {statpoint.%uuid of player%}

                        add 1 to {health.%uuid of player%}

                        execute player command "/스텟"

                        send "&a체력이 올랐습니다!" to player

                        set player's max health to 10+{health.%uuid of player%}

                        stop

            if {health.%uuid of player%} >= 10:

                if {health.%uuid of player%} <= 19:

                    if {statpoint.%uuid of player%} = 2:

                        subtract 2 from {statpoint.%uuid of player%}

                        add 1 to {health.%uuid of player%}

                        execute player command "/스텟"

                        send "&a체력이 올랐습니다!" to player

                        set player's max health to 10+{health.%uuid of player%}

                        stop

                    if {statpoint.%uuid of player%} >= 2:

                        subtract 2 from {statpoint.%uuid of player%}

                        add 1 to {health.%uuid of player%}

                        execute player command "/스텟"

                        send "&a체력이 올랐습니다!" to player

                        set player's max health to 10+{health.%uuid of player%}

                        stop

            if {health.%uuid of player%} >= 20:

                if {health.%uuid of player%} <= 29:

                    if {statpoint.%uuid of player%} = 3:

                        subtract 3 from {statpoint.%uuid of player%}

                        add 1 to {health.%uuid of player%}

                        execute player command "/스텟"

                        send "&a체력이 올랐습니다!" to player

                        set player's max health to 10+{health.%uuid of player%}

                        stop

                    if {statpoint.%uuid of player%} >= 3:

                        subtract 3 from {statpoint.%uuid of player%}

                        add 1 to {health.%uuid of player%}

                        execute player command "/스텟"

                        send "&a체력이 올랐습니다!" to player

                        set player's max health to 10+{health.%uuid of player%}

                        stop

            if {health.%uuid of player%} is 30:

                send "&c%uuid of player%님은 이미 [체력] 스텟에 대해 최고치를 달성하셨습니다." to player

                stop



        if clicked slot is (6):

            if {protect.%uuid of player%} >= 0:

                if {protect.%uuid of player%} <= 9:

                    if {statpoint.%uuid of player%} = 1:

                        subtract 1 from {statpoint.%uuid of player%}

                        add 1 to {protect.%uuid of player%}

                        execute player command "/스텟"

                        send "&a방어력이 올랐습니다!" to player

                        stop

                    if {statpoint.%uuid of player%} >= 1:

                        subtract 1 from {statpoint.%uuid of player%}

                        add 1 to {protect.%uuid of player%}

                        execute player command "/스텟"

                        send "&a방어력이 올랐습니다!" to player

                        stop

            if {protect.%uuid of player%} >= 10:

                if {protect.%uuid of player%} <= 19:

                    if {statpoint.%uuid of player%} = 2:

                        subtract 2 from {statpoint.%uuid of player%}

                        add 1 to {protect.%uuid of player%}

                        execute player command "/스텟"

                        send "&a방어력이 올랐습니다!" to player

                        stop

                    if {statpoint.%uuid of player%} >= 2:

                        subtract 2 from {statpoint.%uuid of player%}

                        add 1 to {protect.%uuid of player%}

                        execute player command "/스텟"

                        send "&a방어력이 올랐습니다!" to player

                        stop

            if {protect.%uuid of player%} >= 20:

                if {protect.%uuid of player%} <= 29:

                    if {statpoint.%uuid of player%} = 3:

                        subtract 3 from {statpoint.%uuid of player%}

                        add 1 to {protect.%uuid of player%}

                        execute player command "/스텟"

                        send "&a방어력이 올랐습니다!" to player

                        stop

                    if {statpoint.%uuid of player%} >= 3:

                        subtract 3 from {statpoint.%uuid of player%}

                        add 1 to {protect.%uuid of player%}

                        execute player command "/스텟"

                        send "&a방어력이 올랐습니다!" to player

                        stop

            if {protect.%uuid of player%} is 30:

                send "&c%uuid of player%님은 이미 [방어] 스텟에 대해 최고치를 달성하셨습니다." to player

                stop


        if clicked slot is (8):

            add {attack.%uuid of player%}+{health.%uuid of player%}+{protect.%uuid of player%}-3 to {statpoint.%uuid of player%}

            set {attack.%uuid of player%} to 1

            set {health.%uuid of player%} to 1

            set {protect.%uuid of player%} to 1

            send "&a스텟이 초기화 되었습니다!"

            set player's max health to 10+{health.%uuid of player%}

            execute player command "/스텟"


on damage:

    if attacker is online:

        add 0.125*{attack.%uuid of attacker%} to damage

        subtract 0.125*{protect.%uuid of victim%} from damage

        

on respawn:

    set player's max health to 10+{health.%uuid of player%}-1


on level change:

    wait 5 ticks

    if player's level >= 0:

        add player's level-{rpg.level.%uuid of player%} to {statpoint.%uuid of player%}

        set {rpg.level.%uuid of player%} to player's level

        send "&6----------------------------" to player

        send "" to player

        send "{@s}  %player%님의 스텟포인트가 1 증가했습니다."

        send "{@s}  현제 스텟포인트: %{statpoint.%uuid of player%}%"

        send "" to player

        send "&6----------------------------" to player


on join:

    if {rpg.level.%uuid of player%} is not set:

        set {rpg.level.%uuid of player%} to 0




on tab complete of "/스텟":

    set tab completions for position 1 to "초기화" 

    if player has permission "stat.set":

        set tab completions for position 1 to "초기화" and "설정"


한마포에 다른분이 올려주신 스텟 스크립트 사용중인데 껏다키면 저장된 변수가 다 초기화가 되네요.. 고수님들 제발 도와주세요ㅠㅠ


Warning
댓글이 없습니다.

새로운 댓글을 등록해 주세요!

뉴스 및 창작물
/files/thumbnails/150/925/003/262x150.crop.jpg?20241123005717

건축

응답하라 1988 ?

팀뉴일리시

2024-11-23

4

/files/thumbnails/761/908/003/262x150.crop.jpg?20241025153749

건축

서울 숭례문(崇禮門) 5

KHC

2024-10-25

2

/files/thumbnails/578/899/003/262x150.crop.jpg?20241010142350

건축

경주 월정교 1

KHC

2024-10-10

2

/files/thumbnails/219/899/003/262x150.crop.jpg?20241009200950

건축

송전탑+도시 2

dbasd12

2024-10-09

2

/files/thumbnails/246/898/003/262x150.crop.jpg?20241008102328

레드스톤

단다단 - 오토노케(オトノケ) | 마인크래프트 노트블럭 커버

노트블럭전문가

2024-10-08

1