Make Armor Stand face entities

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

BALTICA

New Member
Jun 7, 2021
7
0
1
50
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!