How can you teleport behind a player?

I'm trying to make an item for an "assassin" class, where when you hold it, you teleport behind the nearest player. I have found another question, but it only applies to armor stands and doesn't apply to players. So how can you get it to teleport behind the nearest player, preferably looking towards that @p player.


Solution 1:

The other answer is almost correct. Try this:

execute
  as @p[distance=0.1..]
  at @s
run tp @p ^ ^ ^-1 facing entity @s

This command is to be run by the assassin.