I was building a redstone contraption and I had a command with the command gamemode @a[score_deaths_min=1] sp but it didn't work and in the "previous output" section it said @a wasn't a valid number. I already set up a deaths scoreboard objective that had the criteria deathCount. Below is a screenshot of the command block.
it's /gamemode [mode] [player]
not /gamemode [player] [mode]
use /gamemdoe sp @a[score_deaths_min=1]
invalid