I'm trying to make it so that a specific player who enters a region, anywhere between 730, 0, 110 and 760, 256, 137, gets teleported to spawn. I managed to make it so whenever anyone entered the area it would teleport the target player to spawn, but my main goal is to make it so that I can walk around freely while my friend is locked out without having him teleported to spawn 10 times every second. I tried using teams but that wouldn't work either, but maybe I'm just doing it wrong.
I've been using this command,
goawayree being the team I created with the target in it.
execute if entity @a[team=goawayree][x=730,y=0,z=110,dx=50,dy=256,dz=50] run tp @a[team=goawayree] 0 72 0
this was using radius' as i couldnt figure out how i would make a set boundary without 300 armor stands and 13 different headaches. if this isnt possible please please please point out a similar way to do this, ive been looking for solutions online for about 3 days. thanks for the help in advance