Change HUD crosshair when targeted on object

Posting my implementation of the crosshair colour change and shooting form the weapon to the enemy (NOT from the middle of the screen)

First line trace running every 0.1 seconds to measure the distance and find an enemy and written to variables, and the second one is used to shoot.