I've been working on a shooter map for a while now, and i've already cotton weapons and vehicles and stuff to work, but i have encountered an issue i can't figure out a way around. In this map, i really want there to be a mechanic where when you crouch over a weapon, if fills up your xp bar, and when full, it kills the weapon on the ground and gives the player that same weapon. However, when i tried to give any player within 1 block of the armor stand holding the weapon a score, it simply wouldn't do it. This is my command:
It comes back with the error message: "Entity UUID is provided in invalid format; Failed to execute '/scoreboard players set @p[r=1] Rifle 1' as Rifle'
Here's where the problem is. When i simply put it, "/execute @e[type=ArmorStand,name=Rifle] ~ ~ ~ /scoreboard players set @p Rifle 1" without the [r=1] argument, it works fine, but this makes it so players can pick up every weapon on the map wherever they are, which is bad.
Is there any way i can fix this or find a way around it?