개인 자료란 (JE)

  서버 커뮤니티

Profile 궁예 대표칭호 없음
Profile

질문하기 스크립트

원인을 모르겠는 스크립트 오류.. 도와주세요!

2024.09.13 조회 수 71 추천 수 0
이해도 초보자 
게임버전 (JE) 1.12.2 
게임버전 (BE) 관련없음 

아래의 스크립트인데

op가 있을때는 open_cube_gui가 정상적으로 작동하는데

op가 없을때는 open_cube_gui가 오류 메시지도 없이 그냥 작동을 안하네요.


막상 op없이 '/큐브열기' 명령어 사용하면 열리긴하는데..

트리거 스크립트를 통해 아이템 클릭시에 열리게 하고싶은데 무슨 오류인지를 모르겠네요 ㅠㅠㅠ 도와주세요!



options:

p: &6&l  [DOKKISV]&f

function get_cube_rate() :: text:

set {_n} to random integer between 0.9 and 1000

if {_n} is between 1 and 900: 


return "N"

else if {_n} is between 901 and 989: 

return "E"

else if {_n} is between 990 and 999:

return "U"

else if {_n} is 1000:

return "L"

function get_cube_options(r: text, n1m: number, n1a: number, n2m: number, n2a: number, e1m: number, e1a: number, e2m: number, e2a: number, u1m: number, u1a: number, u2m: number, u2a: number, leg: number) :: numbers:

if {_r} is "N":

add random integer between {_n1m} and {_n1a} to {_return::*}

add random integer between {_n2m} and {_n2a} to {_return::*}

else if {_r} is "E":

add random integer between {_e1m} and {_e1a} to {_return::*}

add random integer between {_e2m} and {_e2a} to {_return::*}

else if {_r} is "U":

add random integer between {_u1m} and {_u1a} to {_return::*}

add random integer between {_u2m} and {_u2a} to {_return::*}

else if {_r} is "L":

if {_leg} is 1:

add 5 to {_return::*}

set {_n} to random integer between 0.9 and 10

if {_n} is between 1 and 9:


add 3 to {_return::*}

else:

add 4 to {_return::*}

else if {_leg} is 2:

set {_rr} to random integer between 9 and 10

if {_rr} is 10:

add {_rr} to {_return::*}

add random integer between 5 and 6 to {_return::*}

else:

add {_rr} to {_return::*}

add 6 to {_return::*}

return {_return::*}

function open_cube_gui(p: player):

set {_inv} to chest with 3 row named "{@p} &7큐브"

loop 27 times:

set slot loop-value - 1 of {_inv} to black stained glass pane named "&f"

set slot 10, 13, 16 of {_inv} to air

set slot 13 of {_inv} to anvil named "&6&l[ &f큐브 사용하기 &6&l]" with lore "&f" and " &f모루를 클릭하시면 강화가 시작됩니다." and " &f큐브 사용에는 비용이 들어가니 참고해주세요.   &f" and ""

open {_inv} to {_p}

function return_cube_color(r: text) :: text:

if {_r} is "N":

return "&a&l"

else if {_r} is "E":

return "&5&l"

else if {_r} is "U":

return "&6&l"

else if {_r} is "L":

return "&c&l"

function return_cube_display(r: text) :: text:

if {_r} is "N":

return "일반"

else if {_r} is "E":

return "에픽"

else if {_r} is "U":

return "유니크"

else if {_r} is "L":

return "레전더리"

on right click:

#if player is "ChoRym":

# set {cube::anvil} to event-location

if event-location is {cube::anvil}:

cancel event

open_cube_gui(player)

command /강화불가 [<text>]:

trigger:

player is op

if arg 1 is not set:

message "{@p} 들고있는 템 기준으로 설정"

message "{@p} /강화불가 삭제"

message "{@p} /강화불가 추가"

else if arg 1 is "삭제":

delete {cube::no::%uncolored player's tool's name%}

else if arg 1 is "추가":

set {cube::no::%uncolored player's tool's name%} to true

on inventory click:

if inventory name of current inventory of player is "{@p} &7큐브":

if "%clicked item's name%" is "&f" or "&6&l[ &f큐브 사용하기 &6&l]":

cancel event

if "%clicked item's name%" is "&6&l[ &f큐브 사용하기 &6&l]":

if item amount of slot 10 of current inventory of player is not 1:

message "{@p} 아이템은 한 개만 올려주세요." to player

play sound "entity.villager.no" with volume 1 and pitch 1 to player

stop

if {cube::no::%uncolored slot 10 of current inventory of player's name%} is set:

message "{@p} 옵션 부여가 불가능한 아이템입니다." to player

play sound "entity.villager.no" with volume 1 and pitch 1 to player

stop

if slot 10 of current inventory of player is air:

message "{@p} 강화 장비랑 큐브를 넣어주세요." to player

play sound "entity.villager.no" with volume 1 and pitch 1 to player

stop

if "%uncolored slot 10 of current inventory of player's name%" doesn't contain "투구" or "갑옷" or "바지" or "부츠":

message "{@p} 갑옷만 잠재 옵션 부여가 가능합니다." to player

play sound "entity.villager.no" with volume 1 and pitch 1 to player

stop

if slot 16 of current inventory of player is {cube::cube}:

if player's money < 15000:

send player title "{@p}" with subtitle " &f큐브 강화에 사용되는 비용이 부족합니다." with 0 tick fade in and 0 tick fade out

close player's inventory

play sound "block.anvil.destroy" with volume 1 and pitch 1 to player

stop

remove 15000 from player's money

set {_c} to get_cube_rate()

set {_o::*} to get_cube_options({_c}, 0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 1)

set 7st line of lore of slot 10 of current inventory of player to "   %return_cube_color({_c})%[%{_c}%] &f%return_cube_display({_c})% 잠재옵션"

set 8st line of lore of slot 10 of current inventory of player to "     %return_cube_color({_c})%┖&f 흡혈 확률 +%{_o::1}%%%"

set 9st line of lore of slot 10 of current inventory of player to "     %return_cube_color({_c})%┖&f 자연 치유 +%{_o::2}%"

set slot 13 of current inventory of player to anvil named "&6&l[ &f큐브 사용하기 &6&l]" with lore "" and "   %return_cube_color({_c})%[%{_c}%] &f%return_cube_display({_c})% 잠재옵션" and "     %return_cube_color({_c})%┖&f 흡혈 확률 +%{_o::1}%%%" and "     %return_cube_color({_c})%┖&f 자연 치유 +%{_o::2}%" and "&f"

if {_c} is "U":

broadcast ""

broadcast "   &6&l▪  &f축하합니다. &e&o&l%player%&f 님께서 &6&l&oUnique&f 강화에 성공했습니다.&6&o&l"

broadcast ""

broadcast "   &e&l▪  &f사용된 장비 &7&l( %name of slot 10 of current inventory of player% &7&l)"

broadcast "   &c&l▪  &f부여된 옵션 &7&l( %return_cube_color({_c})%&f 흡혈 확률 &e&l&o+%{_o::1}%%% &7&l/ %return_cube_color({_c})%&f 자연 치유 &e&l&o+%{_o::2}% &7&l)"

broadcast ""

play sound "ui.toast.challenge_complete" with volume 1 and pitch 1 to player

else if {_c} is "L":

broadcast ""

broadcast "   &6&l▪  &f축하합니다. &e&o&l%player%&f 님께서 &c&l&oLegend&f 강화에 성공했습니다.&6&o&l"

broadcast ""

broadcast "   &e&l▪  &f사용된 장비 &7&l( %name of slot 10 of current inventory of player% &7&l)"

broadcast "   &c&l▪  &f부여된 옵션 &7&l( %return_cube_color({_c})%&f 흡혈 확률 &e&l&o+%{_o::1}%%% &7&l/ %return_cube_color({_c})%&f 자연 치유 &e&l&o+%{_o::2}% &7&l)"

broadcast ""

play sound "ui.toast.challenge_complete" with volume 1 and pitch 1 to player

else if slot 16 of current inventory of player is {cube::edi}:

if player's money < 30000:

send player title "{@p}" with subtitle " &f큐브 강화에 사용되는 비용이 부족합니다." with 0 tick fade in and 0 tick fade out

close player's inventory

play sound "block.anvil.destroy" with volume 1 and pitch 1 to player

stop

remove 30000 from player's money

set {_c} to get_cube_rate()

set {_o::*} to get_cube_options({_c}, 1, 3, 0, 1, 4, 6, 2, 3, 7, 9, 4, 5, 2)

set 11st line of lore of slot 10 of current inventory of player to "   %return_cube_color({_c})%[%{_c}%] &f%return_cube_display({_c})% 보조옵션"

set 12st line of lore of slot 10 of current inventory of player to "     %return_cube_color({_c})%┖&f 치명타 확률 +%{_o::1}%%%"

set 13st line of lore of slot 10 of current inventory of player to "     %return_cube_color({_c})%┖&f 치명타 데미지 +%{_o::2}%"

set slot 13 of current inventory of player to anvil named "&6&l[ &f큐브 사용하기 &6&l]" with lore "" and "   %return_cube_color({_c})%[%{_c}%] &f%return_cube_display({_c})% 보조옵션" and "     %return_cube_color({_c})%┖&f 치명타 확률 +%{_o::1}%%%" and "     %return_cube_color({_c})%┖&f 치명타 데미지 +%{_o::2}%" and ""

if {_c} is "U":

broadcast ""

broadcast ""

broadcast "   &6&l▪  &f축하합니다. &e&o&l%player%&f 님께서 &6&l&oUnique&f 강화에 성공했습니다.&6&o&l"

broadcast ""

broadcast "   &e&l▪  &f사용된 장비 &7&l( %name of slot 10 of current inventory of player% &7&l)"

broadcast "   &c&l▪  &f부여된 옵션 &7&l( %return_cube_color({_c})%&f 치명타 확률 &e&l&o+%{_o::1}%%% &7&l/ %return_cube_color({_c})%&f 치명타 데미지 &e&l&o+%{_o::2}% &7&l)"

broadcast ""

play sound "ui.toast.challenge_complete" with volume 1 and pitch 1 to player

else if {_c} is "L":

broadcast ""

broadcast ""

broadcast "   &6&l▪  &f축하합니다. &e&o&l%player%&f 님께서 &c&l&oLegend&e&f 강화에 성공했습니다.&6&o&l"

broadcast ""

broadcast "   &e&l▪  &f사용된 장비 &7&l( %name of slot 10 of current inventory of player% &7&l)"

broadcast "   &c&l▪  &f부여된 옵션 &7&l( %return_cube_color({_c})%&f 치명타 확률 &e&l&o+%{_o::1}%%% &7&l/ %return_cube_color({_c})%&f 치명타 데미지 &e&l&o+%{_o::2}% &7&l)"

broadcast ""

play sound "ui.toast.challenge_complete" with volume 1 and pitch 1 to player

else if slot 16 of current inventory of player is {cube::reset}:

if player's money < 100000:

send player title "{@p}" with subtitle " &f옵션 초기화에 사용되는 비용이 부족합니다." with 0 tick fade in and 0 tick fade out

close player's inventory

play sound "block.anvil.destroy" with volume 1 and pitch 1 to player

stop

remove 100000 from player's money

set {_c} to true

if "%uncolored 7st line of lore of slot 10 of current inventory of player%" contains "[?]":

add 1 to {_o}

if "%uncolored 11st line of lore of slot 10 of current inventory of player%" contains "[?]":

add 1 to {_o}

if {_o} is 2:

message "{@p} 설정된 잠재 옵션이 없습니다." to player

play sound "entity.villager.no" with volume 1 and pitch 1 to player

stop

set slot 13 of current inventory of player to anvil named "&6&l[ &f큐브 사용하기 &6&l]" with lore " &f모루를 클릭하시면 강화가 시작됩니다." and " &f큐브 사용에는 비용이 들어가니 참고해주세요.   &f" and ""

set 7st line of lore of slot 10 of current inventory of player to "&7&l   [?] &f큐브 잠재옵션"

set 8st line of lore of slot 10 of current inventory of player to "     &7&l┖&7 옵션 없음"

set 9st line of lore of slot 10 of current inventory of player to "     &7&l┖&7 옵션 없음"

set 11st line of lore of slot 10 of current inventory of player to "&7&l   [?] &f큐브 보조옵션"

set 12st line of lore of slot 10 of current inventory of player to "     &7&l┖&7 옵션 없음"

set 13st line of lore of slot 10 of current inventory of player to "     &7&l┖&7 옵션 없음"

{_c} is set

remove 1 of slot 16 of current inventory of player from slot 16 of current inventory of player

play sound "block.anvil.use" with volume 1 and pitch 1 to player

stop

on inventory close:

if inventory name of current inventory of player is "{@p} &7큐브":

give slot 10 of current inventory of player to player

give slot 16 of current inventory of player to player

stop

command /큐브 [<text>]:

trigger:

player is op

if arg 1 is not set:

message "{@p} /큐브 잠재큐브설정" to player

message "{@p} /큐브 에디큐브설정" to player

message "{@p} /큐브 초기화큐브설정" to player

message "{@p} /큐브 열기" to player

message "{@p} /큐브 모루설정" to player

else if arg 1 is "잠재큐브설정":

set {cube::cube} to player's tool

message "{@p} 잠재 큐브가 들고 있는 아이템으로 설정되었습니다."

else if arg 1 is "에디큐브설정":

set {cube::edi} to player's tool

message "{@p} 에디 큐브가 들고 있는 아이템으로 설정되었습니다."

else if arg 1 is "초기화큐브설정":

set {cube::reset} to player's tool

message "{@p} 초기화 큐브가 들고 있는 아이템으로 설정되었습니다."

else if arg 1 is "열기":

open_cube_gui(player)

else if arg 1 is "모루설정":

set {cube::anvil} to location of block at player's location

message "{@p} %{cube::anvil}%"

stop

command /큐브열기:

    trigger:

        open_cube_gui(player)




1개의 댓글

windy_wind
2024.09.16

txt나 sk로 깔끔하게 올려주세용

뉴스 및 창작물
/files/thumbnails/761/908/003/262x150.crop.jpg?20241025153749

건축

서울 숭례문(崇禮門) 4

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

/files/thumbnails/348/896/003/262x150.crop.jpg?20241006103035

디도스/봇테러등등을 낚는 방법 4

물귀신

2024-10-06

3