Setting scoreboard score based on player location [closed]

This solution uses 2 command blocks in a chain. The first command block resets the score for all players. The second command block sets the score to 1 for all players within a specified radius from the specified coordinates. Minecraft Java Edition version is currently 1.12.2.

The first command block is RepeatUnconditionalAlways Active with command:

scoreboard players reset @a inSpawn

The second command block is ChainUnconditionalAlways Active with command:

scoreboard players set @a[x=X,y=Y,z=Z,r=R] inSpawn 1

Replace X, Y, and Z with the coordinates. Replace R with the desired radius. The radius will determine how large of an area it will accept players. You can instead use volume arguments in the target selector if you want to specify the area.