For a look at how these complex scripts and AI systems are built in World Builder, check out this tutorial: