You could make a large sphere, hide it and position it at the same position as the enemy. Then, when it detects a collision between you and the sphere, you can make it attack.
You could also get the distance between the enemy and the player manually using the maths, here's is a function that does that (just a quick note, its not mine, can't remember who gave it to me though)
function DistanceFind( objectOne, objectTwo )
pX# = Object position x(objectOne)
pZ# = Object position z(objectOne)
mX# = Object position x(objectTwo)
mZ# = Object position z(objectTwo)
difX=mX#-pX#
difZ=mZ#-pZ#
sqdifX=difX*difX
sqdifZ=difZ*difZ
sqdist=sqdifZ+sqdifX
distance=sqrt(sqdist)
endfunction distance
Then, when you come within a certain distance, run the code your enemy uses to attack.
Cheers,
Kentaree
I would be unstoppable if I could just get started...