Hi everyone! I need help with this script...my problem is this:
I want that the character follow the player, and stop when the player see it.
This is the code that i have
desc = Character AI
:state=0,plrcanbeseen:state=1
;attack player
:state=0,shotdamage=1:state=30
:state=1,shotdamage=1:state=30
:state=2,shotdamage=1:state=30
:state=3,shotdamage=1:state=30
:state=20,shotdamage=1:state=30
:state=1,plrcannotbeseen:state=0,animate=1
;when it see the player it run
:state=1,plrdistfurther=40:rotatetoplr,movefore=6,animate=5
;in posizione di attacco
:state=1,plrdistwithin=40,rateoffire:rotatetoplr,setframe=8,state=2
;attacco
:state=2,framebeyond=8 60,plrdistwithin=50:plraddhealth=-99999,sound=audiobank\atmos\powerhum.wav,state=3
:state=2:incframe=8,rotatetoplr
:state=2,frameatend=8:state=1
:state=3:incframe=8
:state=3,frameatend=8:state=1
;MY PROBLEM
:state=1,plrfacing=45:movefore=0,animate=1,rotatetoplr,state=20
:state=2,plrfacing=45:movefore=0,animate=1,rotatetoplr,state=20
:state=3,plrfacing=45:movefore=0,animate=1,rotatetoplr,state=20
;MY PROBLEM
:state=20,plrnotfacing=45:state=1
:state=20:rotatetoplr
;ritorno alla normalità
:state=30,plralive=0:state=40
:state=40,plralive=1:etimerstart,state=41
:state=41,etimergreater=1000:state=0
;End of Script
It follow the player, but it doesn't stop when i see it...
Thanks in advance!