Code:
function activarTorretas():
loop {listatorretas::*}:
loop all entities in radius 8 around {torreta::%loop-value%}:
if loop-entity is not armor stand:
#set {_l}
send "%loop-entity% | %{_l}% &b%{_yaw}% &a- %{torreta::%loop-value-1%}% %loop-entity%" to all players # IGNORE
damage loop-entity by 3
add "{Rotation:[%{_l}%f]}" to nbt of {torreta::%loop-value-1%}
drawDot count 2, particle "flame", XYZ 0.35, 0.8, 0.35, center location at loop-entity, visibleRange 16, keepFor 2 ticks
stop
Hi, I would like to make an armor stand (loop-value) face an entity (loop-entity), simulating a turret.
I have tried to make it rotate by changing the NBT of the armor stand but I can't figure out how to get the yaw between the armor stand and the entity.
sorry for my bad english, thanks!