テレポートしたとき、元の位置からどれだけ離れたかを変数にぶち込む方法

お願いします
4 Replies
Yeahn
Yeahn8mo ago
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}
{_dist}に距離が入ります。
makaronipizaa
makaronipizaa8mo ago
あ、すみません語弊ありました
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
このコードにどれだけ離れたかの変数をぶち込みたいんですよね やりたいこととしては、どれだけ離れたかでダメージが変わるスキルを作りたいんですけど...
Yeahn
Yeahn8mo ago
であれば同じように前と後の座標を保存するので
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
このようにすればよいかと思われます
makaronipizaa
makaronipizaa8mo ago
うおおおおお!!!! できました!!!! なんとお礼を言ったらいいか.... 本当にありがとうございます!!!!2時間ぐらい悩んでたので助かりました!!!!
Want results from more Discord servers?
Add your server
More Posts
視点を変えずに視点のところへTPする方法多分かなり初歩的な質問だと思うのですが、どうしても分からないのでご教授願います。スペクテイターのプレイヤーのみにタイトル表示させたいスペクテイターのプレイヤーのみにタイトルを表示させようと、 `if loop-player gamemode is “spectator”: send loop-player title “&Skriptでグラップリングフックの作り方右クリックした時に上と前側にプッシュされる簡単なやつではなく、Apexのパスファインダーみたいなグラップルが作りたいです。ほぼ制作依頼にはなりますが、何卒よろしくお願いしますskriptでwebsocketは使えるかskriptで、websocketは使えますか? もし使えたら、ドキュメントなどのURLが欲しいですymlファイルの画像部分のリストの取得方法がぞうのFN_5728みたいな、一番最初のkeyのリストが欲しいです ```yml test1: o: 1 test2: o: 1 test3: o: 1 ``` 例えば上記Y向いている方向に弾を飛ばすやり方を教えて欲しいやりたいことは ピストルを右クリックしたときにプレイヤーの向いている方向に距離減衰なし、即着の弾を飛ばすことです。 弾は透明にして、弾道にパーティクル(crit)をつけたいです。(障害物に当たると弾とon damageでアタッカーとして敵にダメージを入れたい``` on damage: if uncoloured name of attacker's tool is "護身用短剣": make attacker damage viSkrageのon cs damageについてevent-entityとは、ダメージを喰らったentityであっていますか? また、event-stringはダメージを与えた武器の登録名のことですか?特定のスコアを検知する方法例えば`/scoreboard objectives add test dummy`みたいな感じで スコア作ってこの`test`のスコアが1の人みたいな感じで 検知する方法が知りたいですrotateをパケットでかえるskript関数?を作ってほしい作りたいのはこれです https://discord.com/channels/545926404785569793/1133014182170742854 ここの最後のほうで『パケットを使うしかない