how can I teleport an entity to another entity with the same score?

I’m working with interactions and want to assign them to players, but they need to sit 6 blocks in front of each player, and be organized by a scoreboard id. they need to be constantly teleporting too, and the best solution I could find is “at @s if score @s ____ = @n[type=interaction] ____ as @n[type=interaction] run tp @s ~ ~ ~” which works until another interaction gets too close. any help?

Continue to help post