Making a Homing Missile Launcher

I’d like to script a homing missile launcher but the thing is, I can do the “Missle Launcher” part, how do I do the “homing” part? I know I’d have to clarify what kind of target the rocket is aiming at (done that), a player, but how would I write the part where (I’m guessing how to make it) I’d make a loop where it’d keep getting the position of the target until it collides with it? Thanks for the help in advance.

May be more complicated than necessary but you could make the missile a simple nextbot npc and write in a line that makes it asplode when it comes within a certain distance with the target.

That’s a pretty good idea, but, Im looking for something more specific, like as I said, tracking the target until it gets to the distance needed to kill.