Thanks but now i have another question, i have this code:
function check3DDistance(leader)
local pX, pZ, pY = getElementPosition( leader )
local bX, bZ, bY = getElementPosition( source )
local distancia = getDistanceBetweenPoints3D ( pX, pZ, pY, bX, bZ, bY )
outputChatBox ( "the distance between "..getPlayerName(leader).." and the zombie is of "..tonumber(distancia))
end
addEventHandler("onBotFollow", getRootElement(), check3DDistance)
but dont works.. what "callback" i can use to check the distance when the ped is moving..?