[Solved][Coding/Math] Direction to Rotation?

Hello, I'm no good at math so I'm asking here:
How would you modify this RotationToDirection code to instead calculate DirectionToRotation?
Thanks in advance!

Solved! Feel free to use it
Hello, I'm no good at math so I'm asking here:
How would you modify this RotationToDirection code to instead calculate DirectionToRotation?
Thanks in advance!
Solved! Feel free to use it