try
if (x > (y-50)) {
//do something
}
^ that's only if you want a bottom threshold
if you want x to be at least 50 close to y from both sides, then use
if (x > (y-50) && x < (y+50)){
//do something
}
try
if (x > (y-50)) {
//do something
}
^ that's only if you want a bottom threshold
if you want x to be at least 50 close to y from both sides, then use
if (x > (y-50) && x < (y+50)){
//do something
}