How do I select a player outside a cubic area?

I have this problem where when I use a command to select a player outside a cubic area, the command doesn’t work. I’ve tried many ways, including

/effect @a[x=!-32,y=!0,z=!-42,dx=!75,dy=!256,dz=!75] poison 1 0

/effect @a[x=!-32,y=!0,z=!-42,dx=75,dy=256,dz=75] poison 1 0

and

/effect @a[x=-32,y=0,z=-42,dx=!75,dy=!256,dz=!75] poison 1 0

but none of them work. Nothing on YouTube had any good answers to that, either. Is there a way to fix this problem? Thanks


Your best bet is to probably to tag everyone within the area, and then apply the effect to everyone without the tag. You're going to have to use basic scoreboards, since you're on Pocket Edition, so set that up:

/scoreboard objectives add Unpoisoned dummy

Next, every time you want the effect to run, use these three commands:

/scoreboard players set @a Unpoisoned 0
/scoreboard players set @a[x=-32,y=0,z=-42,dx=75,dy=256,dz=75] Unpoisoned 1
/effect @a[score_Unpoisoned=0] poison 1 0

That should poison everyone with an Unpoisoned score of 0, which should be everyone outside the box.