for (temp.i = 0; temp.i < 2; temp.i++) { for (temp.obj: i ? npcs : players) { if (this.x in |obj.x, obj.x + 3| && this.y in |obj.y, obj.y+ 3|) { //hit stuff } }}