I was trying to make a script for an enemy. He's supposed to run away when the player comes within about 10 feet of him, but it doesn't work! Can someone correct my error and tell me why it didn't work? Thanks!
;Artificial Intelligence Script
;Header
desc = Run Away If Player Seen
;Triggers
:random=20:rotateheadrandom=65
:plrdistwithin=3:state=1
:state=1:rotatetotarget,rotatey=180,resethead,animate=5,state=3
:state=3:runfore=10
:state=3,random=5:rotateheadrandom=85
:state=3,losetarget=10:state=10
:state=3,plrcanbeseen:settarget,state=2
:state=10:timerstart,state=11,rotatey=180,animate=31
:state=11,timergreater=5000:state=0,animate=5,waypointstart
:state=11,random=5:rotateheadrandom=35
;End of Script
Alteration 808 Coming soon.