ショットガンの実現とその問題

①雪玉が同時に10個くらいplayerからばらまかれる ②雪玉にset metadata value "damage" of last shot snowball to 1でダメージ設定 ③on projectile collideでmetadetaを取得し、make player damage entity by ~で攻撃する という形式で実現しようとしています…が どうやら一つ目の雪玉しかダメージが通ってないようで… 試しにmake player damage {_target} by 10を大量に同時に送ってみたところ 一つ目しか判定されませんでした(以下テストコード)
on right click:
set {_target} to player's target
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10

on damage:
send "%damage%" to attacker

on damage:
wait 1 tick
set victim's invulnerability ticks to 0
set velocity of victim to vector 0,0,0
on right click:
set {_target} to player's target
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10
make player damage {_target} by 10

on damage:
send "%damage%" to attacker

on damage:
wait 1 tick
set victim's invulnerability ticks to 0
set velocity of victim to vector 0,0,0
これって、解決できますかね…?
51 Replies
わし
わし2y ago
skRageでDamageSource作る
Una_Nancy_Owen
maximum damage delay of playerとかはどうですか あとこの手の処理ってwait挟んでいけるもんなんです?
わし
わし2y ago
https://github.com/akon1248/SkRage でdamagesourceで検索すると無限の可能性を得る
GitHub
GitHub - akon1248/SkRage: Skript Addon
Skript Addon. Contribute to akon1248/SkRage development by creating an account on GitHub.
わし
わし2y ago
set {_dmgSource} to new damagesource with type %string%(自由なstring) でdamaesourceを新規作成 damagesource attacker of {_dmgSource} to %entity% で攻撃者を指定 ignore no damage ticks of {_dmgSource} to true で無敵時間を無視するdamagesourceにする damage %entity% by %number% with damage[ ]source %damagesource% で作ったdamagesource を使ってダメージを与える ノックバックしない設定もある no knockback of %damagesource%とかだっけ
Laminas
Laminas2y ago
これでええんでねえの
わし
わし2y ago
それ永続じゃね あと月猫のコードでできなかったのはwait 1 tickした後(全部ダメージ終わった後)に無敵時間0にしてるからってだけじゃね
月猫ch
月猫chOP2y ago
諏訪線もうちょっと詳しくお願いしていいですか
Una_Nancy_Owen
on join: set maximum damage delay of player to 0 ticks とかでダメージ受けた時のクールダウンが多分0になるんじゃないですか 私は1にしてますから0でどうなるかはよく分かりませんが
月猫ch
月猫chOP2y ago
でもwait 1 tickしないと無敵時間消去できなかった…
Una_Nancy_Owen
ただサボテンとかマグマで即死するようになるので、そこらへんはうまく工夫してください
わし
わし2y ago
じゃあ各make damageの直後に逐次set victim's invulnerability ticks to 0もできないか やはりdamagesource 使おう
月猫ch
月猫chOP2y ago
個々の最後の%damagesource%って何書けばよろし…? cant understund this でした(
わし
わし2y ago
最初にsetした{_dmgSource}ですわ
月猫ch
月猫chOP2y ago
月猫ch
月猫chOP2y ago
SkRage 2.4.4です
on projectile collide:
projectile has metadata value "damage"
set {_player} to shooter of projectile
cancel the event
set {_vec} to velocity of projectile
set {_loc} to location at projectile
set {_loopNum} to floor(normal length of {_vec}) * 2
set normal length of {_vec} to 0.5
set {_HS} to false
set {_LS} to false
loop {_loopNum} times:
set {_loc} to {_loc} ~ {_vec}
if distance between {_loc} and location at entity's head < 0.5:
set {_HS} to true
exit 1 sections
else if distance between {_loc} and location at entity < 0.5:
set {_LS} to true
exit 1 sections
set {_damage} to metadata value "damage" of projectile
message "%{_damage}%" to {_player}
set {_dmgSource} to new damagesource with type "attack"
damagesource attacker of {_dmgSource} to {_player}
ignore creative of {_dmgSource} to true
ignore no damage ticks of {_dmgSource} to true
wait 1 tick
if {_HS} is true:
set {_damage} to {_damage} *2
else if {_LS} is true:
set {_damage} to {_damage} *0.6
else:
set {_damage} to {_damage}
damage entity by {_damage} with damage source {_dmgSource}
on projectile collide:
projectile has metadata value "damage"
set {_player} to shooter of projectile
cancel the event
set {_vec} to velocity of projectile
set {_loc} to location at projectile
set {_loopNum} to floor(normal length of {_vec}) * 2
set normal length of {_vec} to 0.5
set {_HS} to false
set {_LS} to false
loop {_loopNum} times:
set {_loc} to {_loc} ~ {_vec}
if distance between {_loc} and location at entity's head < 0.5:
set {_HS} to true
exit 1 sections
else if distance between {_loc} and location at entity < 0.5:
set {_LS} to true
exit 1 sections
set {_damage} to metadata value "damage" of projectile
message "%{_damage}%" to {_player}
set {_dmgSource} to new damagesource with type "attack"
damagesource attacker of {_dmgSource} to {_player}
ignore creative of {_dmgSource} to true
ignore no damage ticks of {_dmgSource} to true
wait 1 tick
if {_HS} is true:
set {_damage} to {_damage} *2
else if {_LS} is true:
set {_damage} to {_damage} *0.6
else:
set {_damage} to {_damage}
damage entity by {_damage} with damage source {_dmgSource}
あ。いっこめはちょっとむししてください(((
Una_Nancy_Owen
うちの環境なら普通に動くのに...verとかかな https://www.spigotmc.org/resources/simple-hit-delay.80902/ こういうのもあるから限定的な環境下でしか動かないとかもないと思うけども
月猫ch
月猫chOP2y ago
わし
わし2y ago
set damagesource attacker of ~とか setですわよ そのdamagesourceの性質を逐次trueにsetしていくって感じ
月猫ch
月猫chOP2y ago
ハッズ殺してくれ…
月猫ch
月猫chOP2y ago
setつけてもダメだった…
わし
わし2y ago
; ;
月猫ch
月猫chOP2y ago
on projectile collide:
projectile has metadata value "damage"
set {_player} to shooter of projectile
cancel the event
set {_vec} to velocity of projectile
set {_loc} to location at projectile
set {_loopNum} to floor(normal length of {_vec}) * 2
set normal length of {_vec} to 0.5
set {_HS} to false
set {_LS} to false
loop {_loopNum} times:
set {_loc} to {_loc} ~ {_vec}
if distance between {_loc} and location at entity's head < 0.5:
set {_HS} to true
exit 1 sections
else if distance between {_loc} and location at entity < 0.5:
set {_LS} to true
exit 1 sections
set {_damage} to metadata value "damage" of projectile
message "%{_damage}%" to {_player}
set {_dmgSource} to new damagesource with type "attack"
set damagesource attacker of {_dmgSource} to {_player}
set ignore creative of {_dmgSource} to true
set ignore no damage ticks of {_dmgSource} to true
wait 1 tick
if {_HS} is true:
set {_damage} to {_damage} *2
else if {_LS} is true:
set {_damage} to {_damage} *0.6
else:
set {_damage} to {_damage}
damage entity by {_damage} with damage source {_dmgSource}
on projectile collide:
projectile has metadata value "damage"
set {_player} to shooter of projectile
cancel the event
set {_vec} to velocity of projectile
set {_loc} to location at projectile
set {_loopNum} to floor(normal length of {_vec}) * 2
set normal length of {_vec} to 0.5
set {_HS} to false
set {_LS} to false
loop {_loopNum} times:
set {_loc} to {_loc} ~ {_vec}
if distance between {_loc} and location at entity's head < 0.5:
set {_HS} to true
exit 1 sections
else if distance between {_loc} and location at entity < 0.5:
set {_LS} to true
exit 1 sections
set {_damage} to metadata value "damage" of projectile
message "%{_damage}%" to {_player}
set {_dmgSource} to new damagesource with type "attack"
set damagesource attacker of {_dmgSource} to {_player}
set ignore creative of {_dmgSource} to true
set ignore no damage ticks of {_dmgSource} to true
wait 1 tick
if {_HS} is true:
set {_damage} to {_damage} *2
else if {_LS} is true:
set {_damage} to {_damage} *0.6
else:
set {_damage} to {_damage}
damage entity by {_damage} with damage source {_dmgSource}
わし
わし2y ago
ウ↑チ↓のdamagesourceくんは
set {_damagesource} to new damage source with type "player"
set damage source entity of {_damagesource} to player
set ignore no damage ticks of {_damagesource} to true
set prevent knockback of {_damagesource} to true
damage target entity by 9 with damage source {_damagesource}
set {_damagesource} to new damage source with type "player"
set damage source entity of {_damagesource} to player
set ignore no damage ticks of {_damagesource} to true
set prevent knockback of {_damagesource} to true
damage target entity by 9 with damage source {_damagesource}
これで動いてるからぜんぜんわからん 一応skRageは1.12.2しか対応してない
月猫ch
月猫chOP2y ago
月猫ch
月猫chOP2y ago
なんもわからん
わし
わし2y ago
ProtocolLibはいってりゅ? Requiredらしいが
月猫ch
月猫chOP2y ago
月猫ch
月猫chOP2y ago
あかい…
わし
わし2y ago
😢 ProtocolLibのver合わせればいけそう
月猫ch
月猫chOP2y ago
verいくら…?
わし
わし2y ago
wakan nai; ; サーバーのバージョンに合わせるように うちのやつは 5.0.0!?
月猫ch
月猫chOP2y ago
えぇ… どこから拾ってきたの…w
わし
わし2y ago
どこにも存在しない
月猫ch
月猫chOP2y ago
わし
わし2y ago
PlayerRealmsの標準ProtocolLibが 5.0.0なんですけど...
月猫ch
月猫chOP2y ago
thinking
わし
わし2y ago
何者だよこいつは
月猫ch
月猫chOP2y ago
protocolibが赤文字じゃなくなった! skRageは依然赤…
わし
わし2y ago
ウチは2.3.3ですわねskRage
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
コンソールのエラーがneed skRageが有効化されない理由を模索
月猫ch
月猫chOP2y ago
実際に該当コードを読み込んだ時のやつが必須ですかね
わし
わし2y ago
上の見るとdamage sourceを変数にsetするとこはエラー出てないからvery謎
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
skRageを読み込んだ時にエラーが出てると思うので プラグイン読んだ時のログで
月猫ch
月猫chOP2y ago
これですかね… @mirageeeeeeeeeeeeeeeeeeeeeeeeeee
月猫ch
月猫chOP2y ago
どうでしょう…skrageのエラーの理由とかわかりそうな方いますか…
何か
何か2y ago
明らかにprotocollib
月猫ch
月猫chOP2y ago
(´・ω・`) 解決方法…ありますか…?
何か
何か2y ago
何か
何か2y ago
1.12.2は java8で動かさないといろいろバグります これjava18だから 動かないよ
月猫ch
月猫chOP2y ago
これ、java verどうやって変えるんでしたっけ… 自分agamesで鯖借りてるんですよ あ、こうもくあった♥ あ!エラーないなった!!
Want results from more Discord servers?
Add your server