条件をつけると機能しない

on join:
set {centhe2.skill.%player%} to 1

on damage:
if 0 < {centhe2.skill.%attacker%}:
if attacker is not a player:
send "A" to victim
set {_fd} to damage
set damage to {_fd} * 0.1
if attacker is player:
send "B" to attacker
on join:
set {centhe2.skill.%player%} to 1

on damage:
if 0 < {centhe2.skill.%attacker%}:
if attacker is not a player:
send "A" to victim
set {_fd} to damage
set damage to {_fd} * 0.1
if attacker is player:
send "B" to attacker
4 Replies
makaronipizaa
makaronipizaa6mo ago
上のものは簡略化したものですが、「特定のアイテムを右クリックすると15秒間特殊状態に入り、その間受けるダメージ90%減」というのを作ろうとしてました 同じ条件を踏んでいるはずの
if attacker is player:
send "B" to attacker
if attacker is player:
send "B" to attacker
はしっかり機能します が
if attacker is not a player:
send "A" to victim
set {_fd} to damage
set damage to {_fd} * 0.1
if attacker is not a player:
send "A" to victim
set {_fd} to damage
set damage to {_fd} * 0.1
が機能しません 単体(if 0 < {centhe2.skill.%attacker%}: なし)でやるとしっかり機能するのですが、どこが悪いのか分かりません if 0 < {centhe2.skill.%attacker%}: も、send Bの方がしっかり機能しているということはコード自体に問題はなさそうですし
soramame_256
soramame_2566mo ago
if attacker is >a< player んでからon damage2行目の条件で0<none比較が通らなくて動かない setしてるのはプレイヤーだけだもん。 typeがプレイヤーじゃない時点で死 (例えばアタッカーがゾンビなら{centhe2.skill.zombie}が参照されてnone出て死)
makaronipizaa
makaronipizaa6mo ago
あーーーー!!!! 盲点でした!!! この場合%victim%にすれば大丈夫でしょうか
soramame_256
soramame_2566mo ago
動くだろうけどそれで望む動作をするなら。
Want results from more Discord servers?
Add your server
More Posts
スキンが変更されない``` command /skin [<offline player>]: trigger: if arg-1 is set: send requestplayer側だけ特定のアイテムを手に持っているように見えるパケットpacket typeやprotocolibのwikiとにらめっこした末でどうしてもわかりませんでした どなたか『このパケットでできるよ』とか教えていただけないでしょうか… ⇩skript info銃のリロードについて``` on drop: if event-item's name is "LT-AR00": cancel event if {pdata::%player'Skriptで視点を上げてCS銃の反動を作りたいtp <shooter> ~ ~ ~ ~ ~-1というコマンドを発射するとき実行するようにしてみたのですが、 反動自体は動作しても添付した動画の通り銃弾の向きが固定されてしまいます。 遅延があればどUse 'attacker' and/or 'victim' in damage/death events``` on damage: victim is player attacker is not player send "hehehe" to victim ``` で実行すると `Useプレイヤーに矢を刺さらないようにしたい矢のダメージは入るけど、刺さった矢を消したい[クソ長コード]コードの軽量化ymlを読み込み、内容を変数に保存していくコードなのですが 如何せん処理に時間がかかっていて… これを軽量化する方法はないでしょうかitemに個別のkeyとvalueを設定してあげたいentityなら `set metadata "test" of entity to 10` とかできるじゃないですか アイテムでも似たようなことがやりたいです ```applescript set ダイヤモンドを右クリックした後の15秒間、敵にダメージを与えると継続ダメージを与える``` on rightclick holding diamond: set {centhe2.skill.%player%} to 1 set {centhe2.click.%plapushがくそ```applescript on right click: player is op player's tool is getOPItem() push player for