関数と変数の問題

mcpaper-1.18.2 Skript-2.8.2 Addon: ProtocolLib, SkBee, Skellett, SkQuery, skRayFall, Skript, skript-reflect とある関数が別の関数内でのみエラーを吐きます 問題の関数は「parring({_loc2}, crit, 2, 20, 1, 0, player, 1, 0)」です 同じ内容の変数を使用している「laser({_loc}, {_loc2}, end rod, 0.2 ,0.01)」の方は問題が出ていないので原因がよく分かりません 両者の詳細: function laser(start:location ,end:location ,type:particle ,length:number ,diff:number): function parring(loc:location ,type:particle ,size:number ,num:number ,dire:number ,delay:number ,p:entity ,keep: number ,wait: number):
function atk(p:player ,r:number ~省略):
if {wcool.%{_p}%} is set:
stop
set {wcool.%{_p}%} to 1
play sound "%{_sound}%" with volume 1 and pitch {_soundpitch} at {_p}
set {_delay} to "%{_delay}% ticks" parsed as a time span
set {_spd} to {_p}'s walk speed
set {_p}'s walk speed to {_delayspdofp}
wait {_delay}
set {_p}'s walk speed to {_spd}
push {_p} forwards at speed {_delayendoffrontpush}
set {_loc} to location of the block 1.5 meter in front of {_p}'s head
if {_parextra} is 0:
make {_paramo} of {_partype} at {_loc} with offset vector(0.01, 0.01, 0.01) with extra 0.01
else if {_parextra} is 1:
set {_loc} to location of the block 0.5 meter in front of {_p}'s head
set {_loc2} to location of the block {_r} meter in front of {_p}'s head
laser({_loc}, {_loc2}, end rod, 0.2 ,0.01)
else if {_parextra} is 2:
set {_loc} to location of the block 0.2 meters in front of {_p}'s head
set y-coordinate of {_loc} to (y-coordinate of {_loc} + 1)
set {_loc2} to location of the block {_r} meters in front of {_p}'s head
set y-coordinate of {_loc2} to (y-coordinate of {_loc2} - 2)
laser({_loc}, {_loc2}, crit, 0.2 ,0.01)
parring({_loc2}, crit, 2, 20, 1, 0, player, 1, 0)
function atk(p:player ,r:number ~省略):
if {wcool.%{_p}%} is set:
stop
set {wcool.%{_p}%} to 1
play sound "%{_sound}%" with volume 1 and pitch {_soundpitch} at {_p}
set {_delay} to "%{_delay}% ticks" parsed as a time span
set {_spd} to {_p}'s walk speed
set {_p}'s walk speed to {_delayspdofp}
wait {_delay}
set {_p}'s walk speed to {_spd}
push {_p} forwards at speed {_delayendoffrontpush}
set {_loc} to location of the block 1.5 meter in front of {_p}'s head
if {_parextra} is 0:
make {_paramo} of {_partype} at {_loc} with offset vector(0.01, 0.01, 0.01) with extra 0.01
else if {_parextra} is 1:
set {_loc} to location of the block 0.5 meter in front of {_p}'s head
set {_loc2} to location of the block {_r} meter in front of {_p}'s head
laser({_loc}, {_loc2}, end rod, 0.2 ,0.01)
else if {_parextra} is 2:
set {_loc} to location of the block 0.2 meters in front of {_p}'s head
set y-coordinate of {_loc} to (y-coordinate of {_loc} + 1)
set {_loc2} to location of the block {_r} meters in front of {_p}'s head
set y-coordinate of {_loc2} to (y-coordinate of {_loc2} - 2)
laser({_loc}, {_loc2}, crit, 0.2 ,0.01)
parring({_loc2}, crit, 2, 20, 1, 0, player, 1, 0)
Variables cannot be used here. 該当部分: parring({_loc2}, crit, 2, 20, 1, 0, player, 1, 0)
3 Replies
Una_Nancy_Owen
Una_Nancy_OwenOP6mo ago
command /test:
trigger:
set {_p} to player
set {_r} to 4
set {_loc} to location of the block 0.2 meters in front of {_p}'s head
set y-coordinate of {_loc} to (y-coordinate of {_loc} + 1)
set {_loc2} to location of the block {_r} meters in front of {_p}'s head
set y-coordinate of {_loc2} to (y-coordinate of {_loc2} - 2)
laser({_loc}, {_loc2}, crit, 0.2 ,0.01)
parring({_loc2}, crit, 2, 20, 1, 0, player, 1, 0)
command /test:
trigger:
set {_p} to player
set {_r} to 4
set {_loc} to location of the block 0.2 meters in front of {_p}'s head
set y-coordinate of {_loc} to (y-coordinate of {_loc} + 1)
set {_loc2} to location of the block {_r} meters in front of {_p}'s head
set y-coordinate of {_loc2} to (y-coordinate of {_loc2} - 2)
laser({_loc}, {_loc2}, crit, 0.2 ,0.01)
parring({_loc2}, crit, 2, 20, 1, 0, player, 1, 0)
こちらではエラーなし
Una_Nancy_Owen
Una_Nancy_OwenOP6mo ago
https://www.youtube.com/watch?v=v6LXu9CEsMY この動画で円を作っているのが「parring」で直線を作っているのが「laser」です
Una_Nancy_Owen
YouTube
skript function particle 実験その2
https://youtu.be/RL460nlqUbI 上の動画の続きです waitとか挟んでそれっぽい感じになりました
Una_Nancy_Owen
Una_Nancy_OwenOP6mo ago
多角形と放射状のparticleはまた別の関数です だいぶ早いですが解決しました かなり単純なミスでした
Want results from more Discord servers?
Add your server