help with a python script for AI

ok i am making a game and i am doing AI it will react if it is shot at or if it sees the character but i need a script that does a search to see where the closest object with property Hide=1 if hide is equal to 0 i want the character to search farther away

please help and if you have AI examples that would be great

at least people are posting LOL!!!

If i get it right you need a character to find the nearst place to hide!!!
You can make a script to colect all the possible hiding places into a list.
(search for “object dictionary” in the forum).

Once you have all the places on a list you can loop it and calculate the shorter distance from your character to the possible hiding places.

I’ve never did it but i think this idea could work!!