I'm tring to make the Ai on castel maps to close the castel gate when im approaching. I managed to do this by scripting the map but the AI tries to attack me and the gate is opening and closing constantly. I dont know how to make him guarding the gate instead of attacking. I tried every relevant script but same result.
PLS HELP !!!!!!!!!!!!!!!