I tried setCaptive and its not what im looking for, Thanks :D anyway
Well it should not be 50M any distance is good and i saw this command:
" _ESoldier1 doFire _WSoldier1; " this what im looking for but i want to provide a distance
something like this (this is fake command)
" _ESoldier1 doFire _WSoldier1; When_Distance_50m; "
Like when a solider is looking at same side you are coming from he will attack when you are 50M close to him
or
Like zombie when you get close to a zombie he will attack you when you are close to him