개인 자료란 (JE)

  서버 커뮤니티

Profile sw8744 대표칭호 없음

sw8744 1ea5f00ab5164c39bf71d43aad8cc551

Profile

질문하기 스크립트

인챈트 스크립트 질문합니다...

2021.03.08 조회 수 978 추천 수 0
이해도 1.16 
게임버전 (JE) 페이퍼 
게임버전 (BE) SKQuery, Skellet, skUtilities, SKchoke 
스크립트 버전 중급자(필요한 애드온을 찾아서 만들 수 있어요) 
스크립트 애드온 2.5.3 


on load:
    delete {enchant::*}
    add "aqua affinity" to {enchant::*}
    add "bane of athropods" to {enchant::*}
    add "blast protection" to {enchant::*}
    add "channeling" to {enchant::*}
    add "curse of blinding" to {enchant::*}
    add "curse of vanishing" to {enchant::*}
    add "depth strider" to {enchant::*}
    add "efficiency" to {enchant::*}
    add "feather falling" to {enchant::*}
    add "fire aspect" to {enchant::*}
    add "fire protection" to {enchant::*}
    add "flame" to {enchant::*}
    add "fortune" to {enchant::*}
    add "frost walker" to {enchant::*}
    add "impaling" to {enchant::*}
    add "infinity" to {enchant::*}
    add "knockback" to {enchant::*}
    add "looting" to {enchant::*}
    add "loyalty" to {enchant::*}
    add "luck of the sea" to {enchant::*}
    add "lure" to {enchant::*}
    add "mending" to {enchant::*}
    add "multishot" to {enchant::*}
    add "piercing" to {enchant::*}
    add "projectile protection" to {enchant::*}
    add "protection" to {enchant::*}
    add "punch" to {enchant::*}
    add "quick charge" to {enchant::*}
    add "respiration" to {enchant::*}
    add "riptide" to {enchant::*}
    add "sharpness" to {enchant::*}
    add "silk touch" to {enchant::*}
    add "smite" to {enchant::*}
    add "sweeping" to {enchant::*}
    add "thorns" to {enchant::*}
    add "unbreaking" to {enchant::*}


on rightclick on enchanting table:
    cancel event
    open chest with 1 rows named "마법 부여 재설정" to player
    format slot 0 of player with enchanting table named " " with lore " " to close
    format slot 1 of player with enchanting table named " " with lore " " to close
    format slot 2 of player with enchanting table named " " with lore " " to close
    format slot 3 of player with enchanting table named " " with lore " " to close
    format slot 5 of player with enchanting table named " " with lore " " to close
    format slot 6 of player with enchanting table named " " with lore " " to close
    format slot 7 of player with enchanting table named " " with lore " " to close
    format slot 8 of player with enchanting table named " " with lore " " to close


    set slot 4 of player's inventory to {%player%.item} parsed as item


command /enchbook:
    trigger:
        if player is op:
            give 1 book named "&6마법 부여 주문서" to player


on inventory click:
    if inventory name of current inventory of player is "마법 부여 재설정":
        clicked slot is 4:
            remove 1 book named "&6마법 부여 주문서" from player
            set {_num} to random integer between 0 and 38
            set {%player%.lv1} to random integer between 1 and 5
            set {%player%.lv2} to random integer between 1 and 5
            set {%player%.lv3} to random integer between 1 and 5
            set {%player%.lv4} to random integer between 1 and 5
            set {%player%.Lench1} to {enchant::%{_num}%} parsed as enchantment type
            set {_num} to random integer between 0 and 38
            set {%player%.Lench2} to {enchant::%{_num}%} parsed as enchantment type
            set {_num} to random integer between 0 and 38
            set {%player%.Lench3} to {enchant::%{_num}%} parsed as enchantment type
            set {_num} to random integer between 0 and 38
            set {%player%.Lench4} to {enchant::%{_num}%} parsed as enchantment type
            set {%player%.TF} to true
            close player's inventory
            open chest with 1 rows named "마법 부여 재설정" to player
            format slot 0 of player with enchanting table named " " with lore " " to close
            format slot 1 of player with enchanting table named " " with lore " " to close
            format slot 2 of player with enchanting table named " " with lore " " to close
            format slot 3 of player with enchanting table named " " with lore " " to close
            format slot 5 of player with enchanting table named " " with lore " " to close
            format slot 6 of player with enchanting table named " " with lore " " to close
            format slot 7 of player with enchanting table named " " with lore " " to close
            format slot 8 of player with enchanting table named " " with lore " " to close
            format slot 4 of player with {%player%.Lench1} {%player%.lv1}, {%player%.Lench2} {%player%.lv2}, {%player%.Lench3} {%player%.lv3}, {%player%.Lench4} {%player%.lv4} to close #여기서 오류납니다            
            set {%player%.TF} to false






on inventory close:
    if inventory name of current inventory of player is "마법 부여 재설정":
        if {%player%.TF} is false:
            give slot 4 of player's current inventory to player

지금 커스텀 마법부여대를 만들고 있습니다... 여러 오류들은 고쳤으나 마지막 인챈트된 아이템을 다시 보여주는 과정에서 오류가 납니다ㅠㅠㅠㅠㅠ

5개의 댓글

스크립터브혼
2021.03.09

"인챈트된 아이템을 다시 보여주는 과정"이 어디인지 알려주셔야...

sw8744
2021.03.10
@스크립터브혼

open chest with 1 rows named "마법 부여 재설정" to player

format slot 0 of player with enchanting table named " " with lore " " to close

format slot 1 of player with enchanting table named " " with lore " " to close

format slot 2 of player with enchanting table named " " with lore " " to close

format slot 3 of player with enchanting table named " " with lore " " to close

format slot 5 of player with enchanting table named " " with lore " " to close

format slot 6 of player with enchanting table named " " with lore " " to close

format slot 7 of player with enchanting table named " " with lore " " to close

format slot 8 of player with enchanting table named " " with lore " " to close

format slot 4 of player with {%player%.Lench1} {%player%.lv1}, {%player%.Lench2} {%player%.lv2}, {%player%.Lench3} {%player%.lv3}, {%player%.Lench4} {%player%.lv4} to close #여기서 오류납니다

스크립터브혼
2021.03.10
@sw8744

[애드온 없이 GUI 구현하기]를 참고해 주세요.
1.16 버전에서는 format ~ 코드를 사용할 수 없습니다. 사용할 필요도 없구요.

sw8744
2021.03.10
@스크립터브혼

다 set slot 구문으로 고쳤습니다

스크립터브혼
2021.03.10
@sw8744

링크 드린 게시물을 학습하시고 다시 질문주세요. set slot으로 고치는 것 외에 해야할 것이 더 있을겁니다.