I can see a couple things that you could fix.
I do not know why you need to pin Sprite 2 every second and set the target every second. In this instance you could instead do the first event 'On start of Layout'.
Second thing is the 3rd event. If you set the angle to 45 degrees when the turret has a target it will happen every tick, therefore overwriting the other instance where you set the angle. That's why it's always 45 degrees. This can be fixed with putting 'triggered once while true' as a sub-event.
Lastly I don't see how the distance between the turret and the target would give the degrees needed to hit it. To make it work in this fashion is very much complex. You could get that angle if you had it as is now and replaced the '-45 degrees' with the distance you calculated.
Look over these issues, I'll take a closer look if I have the time.