I want to execute a command on all players withhin a distance from an armorstand (Let's call him "A"). The distance is stored in the scoreboard "Distance" for that armorstand ("Distance" of A is e.g. 13). This means that execute as @e[name=A] at @s as @a[distance=..13] ...
doesn't do the trick, because the 13 is a constant here and I don't really want a command for every possible distance from 1 to 100.
I had the idea to store the distance of all players to that armorstand in their "Distance"-score and then compare the 2 scores for every player. But I don't know a way to store the distance in an scoreboard or to get it with a command.
Is there a way to do this?