개인 자료란 (JE)

  서버 커뮤니티

Profile 훤확흑힌 대표칭호 없음

ChaBoon_ f4b74d0854fa4df3813bc1ff2f2a66a4

Profile

질문하기 스크립트

특정 아이템 인벤세이브 스크립트 질문 제발..

2023.12.20 조회 수 140 추천 수 0
이해도 초보자 
게임버전 (JE) 1.20.1 
게임버전 (BE) 관련없음 
스크립트 버전 2.7.3 

플레이어가 죽었을때 "인벤세이브"라는 설명이 있는 아이템만 인벤세이브 되게 하고싶은데

어딜 찾아봐도 전문은 없네요,,,,ㅠㅠㅠ

고수님들 부탁드려요ㅠ




6개의 댓글

라아아아밍
2023.12.20

음.. 일단 죽었을 때와 리스폰되었을 때라는 이벤트가 필요할 듯하고요

변수를 {inv::save::%player%::*}라고 하겠습니다.


on death of player:
  set {_inv} to inventory of event-entity #이건 처음이라 맞을지 모르겠습니다.. 문법상 맞을 듯 한데
  loop 36 times:
    lore of slot loop-number - 1 of {_inv} contains "인벤세이브"
    set {inv::save::%event-entity%::%loop-number - 1%} to slot loop-number - 1 of {_inv}
  loop 4 times:
    lore of slot 100 + loop-number - 1 of {_inv} contains "인벤세이브"
    set {inv::save::%event-entity%::%100 + loop-number - 1%} to slot 100 + loop-number - 1 of {_inv} #이것도..
  lore of slot -106 of {_inv} contains "인벤세이브"
  set {inv::save::%event-entity%::106} to slot -106 of {_inv} #이것도..


on respawn:
  set {_inv} to inventory of event-player
  loop 36 times:
    set slot loop-number - 1 of {_inv} to {inv::save::%event-entity%::%loop-number - 1%}
  loop 4 times:
    set slot 100 + loop-number - 1 of {_inv} to {inv::save::%event-entity%::%100 + loop-number - 1%}
  set slot -106 of {_inv} to {inv::save::%event-entity%::106}

아무래도 이렇게 하면 되지 않을까합니다.. 오류 있으면 댓글 달아주시면 다시 확인해보겠습니다.

훤확흑힌
2023.12.20
@라아아아밍

그대로 했는데 안되네요ㅠㅠ 에드온은 skUtilities, skUtilities, SkQuery 사용중입니다..!

훤확흑힌
2023.12.20
@훤확흑힌

[23:15] 라인 2: (인벤세이브.sk) [3]

[23:15] Use 'attacker' and/or 'victim' in damage/death events [3]

[23:15] 라인 5: (인벤세이브.sk)

[23:15] Use 'attacker' and/or 'victim' in damage/death events [5]

[23:15] 라인 8: (인벤세이브.sk)

[23:15] Use 'attacker' and/or 'victim' in damage/death events [7]

[23:15] 라인 10: (인벤세이브.sk) [2]

[23:15] Use 'attacker' and/or 'victim' in damage/death events [9]

[23:15] 라인: set {inv::save::%event-entity%::106} to slot -106 of {_inv}#이것도.. [2]

이렇게 떴습니다!

 

세찐찐
2023.12.20
@훤확흑힌

코드에 on death 이벤트의 event-entity -> victim으로 변경해주세요

훤확흑힌
2023.12.21
@세찐찐

적용은 되었습니다 그런데 아이템이 복사가 됩니다.. 바닥에도 떨어지고ㅠㅠ

훤확흑힌
2023.12.21
@훤확흑힌

on death:

loop drops:

if lore of loop-item contains "인벤세이브":

remove loop-item from drops

wait 5 ticks

add loop-item to victim's inventory

이렇게 작성해서 정상작동합니다 필요하신 다른 분들도 사용하세요 감사합니다

 

뉴스 및 창작물
/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

0

/files/thumbnails/576/775/003/262x150.crop.jpg?20240426232553

아티클

이달의 블록: 단단한 진흙

학교가기싫다

2024-04-26

0

/files/thumbnails/115/774/003/262x150.crop.jpg?20240428135129

업데이트

마인크래프트 1.20.5 정식 업데이트

학교가기싫다

2024-04-24

0

/files/thumbnails/762/770/003/262x150.crop.jpg?20240418073724

레드스톤

T.B.H (고민중독) | 노트블럭 버전 | NoteBlock Cover [한국어 영어 중국어 가사 추가]

노트블럭전문가

2024-04-18

0

/files/thumbnails/218/767/003/262x150.crop.jpg?20240412130213

레드스톤

우리의 꿈 - 원피스 오프닝

노트블럭전문가

2024-04-12

0