particle crit ~ ~ ~
#execute if block ~ ~ ~ #survivalplus:nobounce positioned ^ ^ ^.5 run function survivalplus:tools/trap/ballista/laser

execute if entity @e[dx=0,type=!#survivalplus:notalive] positioned ~-0.99 ~-0.99 ~-0.99 if entity @e[dx=0,type=!#survivalplus:notalive] run tag @s add hittarget
execute if entity @e[dx=0,type=!#survivalplus:notalive] positioned ~-0.99 ~-0.99 ~-0.99 if entity @e[dx=0,type=!#survivalplus:notalive] run playsound minecraft:entity.arrow.hit neutral @a ~ ~ ~ 2 .8
execute as @e[dx=0,type=!#survivalplus:notalive] positioned ~-0.99 ~-0.99 ~-0.99 if entity @s[dx=0,type=!#survivalplus:notalive] run damage @s 25 arrow by @n[tag=ballista_stand]

execute if entity @s[distance=..100,tag=!hittarget] if block ~ ~ ~ #survivalplus:nobounce positioned ^ ^ ^.5 run function survivalplus:tools/trap/ballista/laser
tag @s remove hittarget