... You know 'getElementPosition' only has 1 argument, called the element? How could you ever, ever, ever throw those positions into it...
If I was you, I should create a marker or a collshape. As soon as the player hits it (onPlayerMarkerHit/onClientMarkerHit/onElementColShapeHit/onClientElementColShapeHit) open or close it. (Could be done with onPlayerMarkerLeave/onClientMarkerLeave/onElementColShapeLeave/onClientElementColShapeLeave)