vgames master,
Are you only wanting to detect distance on the x axis? If not, and you are needing to detect distance between two objects on both the x and y axises, try this formula.
sqrt((xpos1 - xpos2)^2 + (ypos1 - ypos2)^2), where xpos1 and ypos1 is the player character, and xpos2 and ypos2 is anything else. This will give you the distance between two points at any angle and any value(negative or positive).
So, in your code you are wanting to detect distance if the
SHIFTKEY() is pressed. So, try
REM only calculate distance if shiftkey is pressed(processor saver)
if shiftkey() = 1
if sqrt((xpos1 - xpos2)^2 + (ypos1 - ypos2)^2) =< 60
'code to execute goes here'
endif
endif
+NanoBrain+