It depends on how complex you want that AI to be. You can use a simple “If X then Y” system like Final Fantasy 12 did with the Gambit system. Roblox has a simple scripting system for behaviors IIRC. You can look at Microsofts SPARK game which was meant to do something similar, same with Little Big Planet and their creation tools.