Hello! I recently made a script so an entity can follow a waypoint around the map and if the player is spotted it will then chase the player. I had just tested it out and for some odd reason the entity that I was using just randomly stops while playing the walking animation and will continuously walk back and fourth. Still don't know how to use code snippet sorry.
;Artificial Intelligence Script
;Triggers
desc = Total Horror By FP
;Triggers
:activated=97:destroy,music=audiobank\music\generic\rise.wav,musicvolume=20
:state=6,plrdistwithin=449:musicvolume=20
:state=6,plrdistwithin=399:musicvolume=30
:state=6,plrdistwithin=349:musicvolume=40
:state=6,plrdistwithin=299:musicvolume=50
:state=6,plrdistwithin=249:musicvolume=60
:state=6,plrdistwithin=199:musicvolume=70
:state=6,plrdistwithin=149:musicvolume=80
:state=6,plrdistwithin=99:musicvolume=90
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
:state=0:waypointstart,state=1
:state=1,plrdistwithin=150:settarget,animate=5,rotatetotarget,music=audiobank\music\ChaseTheme.wav,state=2
:losetarget=170:state=0,setentityspeed=135,musicvolume=20,stopsound,music=audiobank\music\generic\rise.wav,musicvolume=20,waypointstart
:state=2:waypointstop,movetotarget,state=6
:state=6,plrdistfurther=70:rotatetoplr,movefore=2,animate=5
:state=6,plrdistwithin=70,rateoffire:rotatetoplr,setframe=6,state=4
:state=4,framebeyond=6 60,plrdistwithin=70:plraddhealth=-20,state=5
:state=4:incframe=6,rotatetoplr
:state=4,frameatend=6:state=6
:state=5:incframe=6
:state=5,frameatend=6:state=6