変数に変数を追加したい

add {_amount} to {money::%player%}
add {_amount} to {money::%player%}
この構文が動作しません.skver2.6.4 pr環境
6 Replies
Lafchqn/らふ
Lafchqn/らふOP3w ago
グローバル変数などでやっても無理でした set {~} to {~} + {~~}でもできませんでした 加算する変数を数字に変えたらいけるようです(変数では不可)
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
変数の中身が確実におかしいです
set {_amount} to "1"
set {_amount} to "1"
とかやっていませんか?
Lafchqn/らふ
Lafchqn/らふOP3w ago
してないです デバッグしたとこ amountが4, moneyが4でした
on break:
if player's gamemode is not creative:
if event-block is stone or coal ore or iron ore or gold ore or diamond ore:
if {money::%player%} is not set:
set {money::%player%} to 0
cancel event
set {_lore::*} to lore of player's tool
if {_lore::2} is set:
set {_sl} to {_lore::2}
replace all "&7" and "採掘取得量 : " and " " in {_sl} with ""
set {_x} to random number between -1 and 1
set {_z} to random number between -1 and 1
bind hologram "&a⛏ +%{_sl}%" to player for 1 second offset by {_x}, 2.3, {_z}
send "%{_sl}%" to player
set {money::%player%} to {money::%player%} + {_sl}
send "%{money::%player%}%" to player
else:
cancel event
on break:
if player's gamemode is not creative:
if event-block is stone or coal ore or iron ore or gold ore or diamond ore:
if {money::%player%} is not set:
set {money::%player%} to 0
cancel event
set {_lore::*} to lore of player's tool
if {_lore::2} is set:
set {_sl} to {_lore::2}
replace all "&7" and "採掘取得量 : " and " " in {_sl} with ""
set {_x} to random number between -1 and 1
set {_z} to random number between -1 and 1
bind hologram "&a⛏ +%{_sl}%" to player for 1 second offset by {_x}, 2.3, {_z}
send "%{_sl}%" to player
set {money::%player%} to {money::%player%} + {_sl}
send "%{money::%player%}%" to player
else:
cancel event
一応全文です
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
loreはstringですから、{_sl}にはstringが入っていることになります https://discord.com/channels/545926404785569793/587090563074097199/905456886608982047 このような関数を利用するなどして、数値をintegerなどで取得する必要があります
Lafchqn/らふ
Lafchqn/らふOP3w ago
すみませんありがとうございます
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
replaceの下に以下のコードを挿入しても良いです
set {_sl} to {_sl} parsed as integer
set {_sl} to {_sl} parsed as integer
Want results from more Discord servers?
Add your server