You can’t really compare vector3 values that way, but let’s imagine you could, then the code would look like this:
if pos >= vmath.vector3(...) or pos <= vmath.vector3(...) then
print("foobar")
end
So how to really solve this? It looks like you want to reset the position if outside of a 20 by 20 pixel box centered on 880, 585. One option is to compare each component individually:
if pos.x >= 890 or pos.y >= 595 or pos.x <= 870 or pos.y <= 575 then
print("foobar")
end
Another option is to first calculate the difference between the position and the center:
local diff = pos - vmath.vector3(880, 585, 1)
if math.abs(diff.x) >= 10 or math.abs(diff.y) >= 10 then
print("foobar")
end
If you are ok with it being a circle instead of a box then calculate the length/distance from the center instead:
local length = vmath.length(pos - vmath.vector3(880, 585, 1))
if length >= 10 then
print("foobar")
end