4 Replies
on teleport:
set {_past} to past event-location
set {_future} to future event-location
set {_dist} to distance between {_past} and {_future}
on teleport:
set {_past} to past event-location
set {_future} to future event-location
set {_dist} to distance between {_past} and {_future}
あ、すみません語弊ありました
このコードにどれだけ離れたかの変数をぶち込みたいんですよね
やりたいこととしては、どれだけ離れたかでダメージが変わるスキルを作りたいんですけど...
on rightclick holding enchanted book:
if uncoloured name of player's tool is "test":
if {skill.last::%player%} is set:
difference of {skill.last::%player%} and now < 2 seconds
stop
set {_pos} to location of target block
set yaw of {_pos} to yaw of player
set pitch of {_pos} to pitch of player
add 0.5 to y-loc of {_pos}
teleport player to {_pos}
loop all entities in radius 4 around player:
if loop-entities isn't "%player%":
make player damage loop-entity by (ここに変数を入れたい)
execute console command "/playsound minecraft:entity.lightning_bolt.impact master %player% ~ ~ ~ 1 0.5 1"
set {_test} to location of the block 0 meter in front of player
show 500 "SPELL_INSTANT" particles at {_test} for player offset by 3, -1, 3
show 1000 "FIREWORKS_SPARK" particles at {_test} for player offset by 5, 0, 5
set {skill.last::%player%} to now
on rightclick holding enchanted book:
if uncoloured name of player's tool is "test":
if {skill.last::%player%} is set:
difference of {skill.last::%player%} and now < 2 seconds
stop
set {_pos} to location of target block
set yaw of {_pos} to yaw of player
set pitch of {_pos} to pitch of player
add 0.5 to y-loc of {_pos}
teleport player to {_pos}
loop all entities in radius 4 around player:
if loop-entities isn't "%player%":
make player damage loop-entity by (ここに変数を入れたい)
execute console command "/playsound minecraft:entity.lightning_bolt.impact master %player% ~ ~ ~ 1 0.5 1"
set {_test} to location of the block 0 meter in front of player
show 500 "SPELL_INSTANT" particles at {_test} for player offset by 3, -1, 3
show 1000 "FIREWORKS_SPARK" particles at {_test} for player offset by 5, 0, 5
set {skill.last::%player%} to now
であれば同じように前と後の座標を保存するので
このようにすればよいかと思われます
on rightclick holding enchanted book:
if uncoloured name of player's tool is "test":
if {skill.last::%player%} is set:
difference of {skill.last::%player%} and now < 2 seconds
stop
set {_pos} to location of target block
set yaw of {_pos} to yaw of player
set pitch of {_pos} to pitch of player
add 0.5 to y-loc of {_pos}
set {_loc} to player's location
teleport player to {_pos}
set {_dist} to distance between {_pos} and {_loc}
loop all entities in radius 4 around player:
if loop-entities isn't "%player%":
make player damage loop-entity by {_dist}
execute console command "/playsound minecraft:entity.lightning_bolt.impact master %player% ~ ~ ~ 1 0.5 1"
set {_test} to location of the block 0 meter in front of player
show 500 "SPELL_INSTANT" particles at {_test} for player offset by 3, -1, 3
show 1000 "FIREWORKS_SPARK" particles at {_test} for player offset by 5, 0, 5
set {skill.last::%player%} to now
on rightclick holding enchanted book:
if uncoloured name of player's tool is "test":
if {skill.last::%player%} is set:
difference of {skill.last::%player%} and now < 2 seconds
stop
set {_pos} to location of target block
set yaw of {_pos} to yaw of player
set pitch of {_pos} to pitch of player
add 0.5 to y-loc of {_pos}
set {_loc} to player's location
teleport player to {_pos}
set {_dist} to distance between {_pos} and {_loc}
loop all entities in radius 4 around player:
if loop-entities isn't "%player%":
make player damage loop-entity by {_dist}
execute console command "/playsound minecraft:entity.lightning_bolt.impact master %player% ~ ~ ~ 1 0.5 1"
set {_test} to location of the block 0 meter in front of player
show 500 "SPELL_INSTANT" particles at {_test} for player offset by 3, -1, 3
show 1000 "FIREWORKS_SPARK" particles at {_test} for player offset by 5, 0, 5
set {skill.last::%player%} to now
うおおおおお!!!!
できました!!!!
なんとお礼を言ったらいいか....
本当にありがとうございます!!!!2時間ぐらい悩んでたので助かりました!!!!