Let's say you're trying to find the distance between Player and Object, you could create a variable called Distance.
Distance = int(abs(Player.X-Object.X)+abs(Player.Y-Object.Y))
Then you'd create an event: "System" -> "Compare 2 Values" and then create your comparison however you want (ie. Distance < 5)