Hello to all, I want to share script that was made by Omegamer(http://forum.thegamecreators.com/?m=forum_view&t=178493&b=23)
But his script had a lot of bugs.So, i fixed it, and now there no problem with error.
desc = Random Melee Attack by Saint and Omegamer
;Triggers
:state=0:setaiactive=1,alwaysactive=1
:always:aisettarget,aisetspeed=350
:nearactivatable=0:settarget,activatetarget=2
;DETECT PLAYER AND IDLE
:state=0,plrdistfurther=1000:animate=95
:state=0,plrdistwithin=1000,plrcanbeseen:state=5,airotatetotarget
;CHOOSE MELEE ATTACK & RUN OR WALK
:state=5,random=6:state=11
:state=5,random=6:state=66
:state=5,random=6:state=12
:state=5,random=6:state=6
:state=5,random=6:state=13
:state=5,random=6:state=1
;MELEE ATTACK 1 (DOUBLE ARM SLASH)
:state=1,plrdistfurther=60:airotatetotarget,aimovetotarget,animate=93
:state=1,plrdistwithin=60:airotatetotarget,setframe=98,state=7
:state=7,framebeyond=98 40,plrdistwithin=60:plraddhealth=-5,sound=audiobank\zombie_apocalypse\femalescream3.wav,state=8
:state=7:incframe=98,rotatetoplr
:state=7,frameatend=98:state=5
:state=8,framebeyond=98 60,plrdistwithin=60:plraddhealth=-2,sound=audiobank\misc\melee.wav,state=9
:state=8:incframe=98
:state=8,frameatend=98:state=5
:state=9:incframe=98
:state=9,frameatend=98:state=5
;MELEE ATTACK 2 (OVERHEAD SLASH RIGHT)
:state=6,plrdistfurther=60:rotatetoplr,aimovetotarget,animate=93
:state=6,plrdistwithin=60:rotatetoplr,setframe=101,state=2
:state=2,framebeyond=101 60,plrdistwithin=60:plraddhealth=-5,sound=audiobank\zombie_apocalypse\femalescream3.wav,state=3
:state=2:incframe=101,rotatetoplr
:state=2,frameatend=101:state=5
:state=3:incframe=101
:state=3,frameatend=101:state=5
;MELEE ATTACK 3 (SINGLE ARM SLASH)
:state=66,plrdistfurther=60:rotatetoplr,aimovetotarget,animate=93
:state=66,plrdistwithin=60:rotatetoplr,setframe=99,state=22
:state=22,framebeyond=99 50,plrdistwithin=60:plraddhealth=-5,sound=audiobank\misc\melee.wav,state=33
:state=22:incframe=99,rotatetoplr
:state=22,frameatend=99:state=5
:state=33:incframe=99
:state=33,frameatend=99:state=5
;MELEE ATTACK 4 (OVERHEAD SLASH LEFT)
:state=11,plrdistfurther=60:rotatetoplr,aimovetotarget,animate=93
:state=11,plrdistwithin=60:rotatetoplr,setframe=100,state=77
:state=77,framebeyond=100 60,plrdistwithin=60:plraddhealth=-5,sound=audiobank\misc\melee.wav,state=88
:state=77:incframe=100,rotatetoplr
:state=77,frameatend=100:state=5
:state=88:incframe=100
:state=88,frameatend=100:state=5
;RAGE ANIMATION 1
:state=12,plrdistfurther=60:rotatetoplr,aimovetotarget,animate=93
:state=12,plrdistwithin=60:rotatetoplr,setframe=102,state=78
:state=78,framebeyond=102 40,plrdistwithin=160:sound=audiobank\zombie_apocalypse\femalescream2.wav,state=89
:state=78:incframe=102,rotatetoplr
:state=78,frameatend=102:state=5
:state=89:incframe=102
:state=89,frameatend=102:state=5
;RAGE ANIMATION 2
:state=13,plrdistfurther=60:rotatetoplr,aimovetotarget,animate=93
:state=13,plrdistwithin=60:rotatetoplr,setframe=103,state=79
:state=79,framebeyond=103 40,plrdistwithin=160:sound=audiobank\zombie_apocalypse\femalescream1.wav,state=90
:state=79:incframe=103,rotatetoplr
:state=79,frameatend=103:state=5
:state=90:incframe=103
:state=90,frameatend=103:state=5