How would I check to see if a scoreboard objective is not greater than a certain integer in Minecraft command blocks

Currently I'm trying to create a system that only allows certain command block events to trigger once to each person. Rather than setting up a system at the spawn to set the starting value for the points objective for each new player to 0 I want to create a series of command blocks to check if the player's points value is less than a certain number (to prevent them from triggering it multiple times). I hope that it could also apply to undefined starting values, that way new players could still trigger it the first time as well.

I've come up with an unsuccessful solution

/testfor @a[score_points_min!=1]

and would appreciate any assistance with this predicament.


Solution 1:

There is no score_points_max argument. The score_points argument selects entities with scores less than or equal to the value. Therefore, the solution is

testfor @a[score_points=0]

However, this will not work for players with no score at all. You will need to use

scoreboard players add @a points 0

to give players with no score a score of zero. Alternatively, you could tag players once they max out their score, and only apply the trigger to players without the tag.