インベントリに入っているアイテムの説明にある数字が読み込めない

if name of current inventory contain "&7&l修復":
cancel event
if event-inventory is player's inventory:
cancel event
if event-item is pickaxe:
if slot 11 of player's current inventory is air:
set slot 11 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&6砥石":
if slot 12 of player's current inventory is air:
set slot 12 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&a修復する":
cancel event
set {_tool::1} to slot 11 of player's current inventory
set {_repair::1} to slot 12 of player's current inventory
set slot 15 of player's current inventory to {_tool::1}
set {_mine.repair_item::*} to uncolored line 1 of lore of {_repair::1} parsed as "Repair: %number%"
if parse error is not set:
set {_repair.amount::*} to {_mine.repair_item::1}
set {_mine.tool_health::*} to uncolored line 9 of lore of {_tool::1} parsed as "Durability %number% / %number%"
if parse error is not set:
set {_maxmum::*} to {_mine.tool_health::2}
set {_health::*} to {_mine.tool_health::1}
add {_repair.amount::*} to {_health::*}
if {_health::*} > {_maxmum::*}:
set {_health::*} to {_maxmum::*}
set line 9 of lore of slot 15 of player's current inventory to "&aDurability &f%{_health::*}% / %{_maxmum::*}%"
set slot 11 of player's current inventory to air
set slot 12 of player's current inventory to air
if name of current inventory contain "&7&l修復":
cancel event
if event-inventory is player's inventory:
cancel event
if event-item is pickaxe:
if slot 11 of player's current inventory is air:
set slot 11 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&6砥石":
if slot 12 of player's current inventory is air:
set slot 12 of player's current inventory to 1 of event-item
remove 1 of event-item from player's inventory
if name of event-item is "&a修復する":
cancel event
set {_tool::1} to slot 11 of player's current inventory
set {_repair::1} to slot 12 of player's current inventory
set slot 15 of player's current inventory to {_tool::1}
set {_mine.repair_item::*} to uncolored line 1 of lore of {_repair::1} parsed as "Repair: %number%"
if parse error is not set:
set {_repair.amount::*} to {_mine.repair_item::1}
set {_mine.tool_health::*} to uncolored line 9 of lore of {_tool::1} parsed as "Durability %number% / %number%"
if parse error is not set:
set {_maxmum::*} to {_mine.tool_health::2}
set {_health::*} to {_mine.tool_health::1}
add {_repair.amount::*} to {_health::*}
if {_health::*} > {_maxmum::*}:
set {_health::*} to {_maxmum::*}
set line 9 of lore of slot 15 of player's current inventory to "&aDurability &f%{_health::*}% / %{_maxmum::*}%"
set slot 11 of player's current inventory to air
set slot 12 of player's current inventory to air
これで実行したんですけどツールのほうしか動かないです
7 Replies
くr
くrOP15mo ago
イベントはon inventory clickです これアイテム(砥石)を消費して耐久値を増やせるようにできるSkriptです
くr
くrOP15mo ago
これは動かしてみたやつです
No description
No description
No description
くr
くrOP15mo ago
この2枚目の写真の
Repair: 37
Repair: 37
が読み込めません 両方読み込むにはどうすればいいですか
gladiolus8789
gladiolus878915mo ago
set {_lore::*} to split "%lore of clicked item%" by " " set {_repair} to {_lore::2} parsed as number でいけませんか clicked item は event-itemでもいいと思います
くr
くrOP15mo ago
できませんでした エラーはなかったです
月猫ch
月猫ch15mo ago
function getGunReloadNum(item: item) :: number:
set {_lores::*} to lore of {item}
set {_reloadNum} to 0
set {_num} to 1
loop {_lores::*}:
set {_lores::%{_num}%} to uncoloured loop-value
add 1 to {_num}
loop {_lores::*}:
if loop-value starts with "Ammo Capacity":
set {_parsed::*} to loop-value parsed as "Ammo Capacity: %number%"
set {_reloadNum} to {_parsed::1}
exit 2 sections
return {_reloadNum}
function getGunReloadNum(item: item) :: number:
set {_lores::*} to lore of {item}
set {_reloadNum} to 0
set {_num} to 1
loop {_lores::*}:
set {_lores::%{_num}%} to uncoloured loop-value
add 1 to {_num}
loop {_lores::*}:
if loop-value starts with "Ammo Capacity":
set {_parsed::*} to loop-value parsed as "Ammo Capacity: %number%"
set {_reloadNum} to {_parsed::1}
exit 2 sections
return {_reloadNum}
これはloreの Ammo Capacity: number を取得する関数です 良かったら参考にどうぞ
くr
くrOP15mo ago
: この記号消したらできました
Want results from more Discord servers?
Add your server