Minecraft – In Minecraft, I want to testfor if a player is on one team or the other

minecraft-java-edition

I want to testfor if a player is on team 1, but if he is on team 2, then the comparator will still activate. I tried: testfor @p[team=1,team=2]
It only works for team 2 though. Probably because it is at the end. or something. Is it even possible for what I'm doing. Is there a different way maybe?

Best Answer

Use two seperate commandblocks /testfor @p[team=1] and /testfor @p[team=2] ,then connect the comparator outputs