//FactoryF ReferenceScript { Script=GenericDefend Source=Global ReturnState=Base Conditions { if IAm "r2d2" == 0 } } state Base { Conditions { if IAm "R2D2" == 1 goto DroidUpdate if IAm "C3PO" == 1 goto DroidUpdate if PreviousResult == 0 goto NormalUpdate } Actions { } } state NormalUpdate { Conditions { if InTriggerArea "maze" == 1 goto InMaze } Actions { FollowPlayer "0.75" } } state DroidUpdate { Conditions { if InTriggerArea "maze" == 1 goto InMaze } Actions { FollowPlayer "1.5" } } state InMaze { Conditions { if InTriggerArea "maze" == 0 goto Base } Actions { FacePlayer } }