Steven1985
Active member
The following script I have adapted it for the cpu-controlled character. Is it OK?
C:
anim attack3
@script
if(frame == 0) {
if (readKey("b")) { changeState("GRABBACKWARD"); }
else if (readKey("f")) { changeState("GRABFORWARD"); }
}
@end_script
#fastattack 1
hitfx data/sounds/beat3.wav
loop 0
offset 238 177
bbox 222 102 33 76
sound data/sounds/punisher08.wav
delay 3
frame data/chars/players/punisher/a301.gif
frame data/chars/players/punisher/a302.gif
frame data/chars/players/punisher/a303.gif
sound data/sounds/vuu3.wav
delay 10
attack 240 105 69 60 20 1 0 0 30 15
frame data/chars/players/punisher/a304.gif
attack 0 0 0 0 0 0 0 0 0
delay 4
frame data/chars/players/punisher/a305.gif
frame data/chars/players/punisher/a306.gif
frame data/chars/players/punisher/a307.gif
C:
anim attack3
@script
if(frame == 0) {
int randomAction = rand()%3; // Generate a random number between 0 and 2
if (randomAction == 0) {
changeentityproperty(self, "animation", openborconstant("ANI_GRABBACKWARD"));
} else if (randomAction == 1) {
changeentityproperty(self, "animation", openborconstant("ANI_GRABFORWARD"));
}
}
@end_script
#fastattack 1
hitfx data/sounds/beat3.wav
loop 0
offset 238 177
bbox 222 102 33 76
sound data/sounds/punisher08.wav
delay 3
frame data/chars/players/punisher/a301.gif
frame data/chars/players/punisher/a302.gif
frame data/chars/players/punisher/a303.gif
sound data/sounds/vuu3.wav
delay 10
attack 240 105 69 60 20 1 0 0 30 15
frame data/chars/players/punisher/a304.gif
attack 0 0 0 0 0 0 0 0 0
delay 4
frame data/chars/players/punisher/a305.gif
frame data/chars/players/punisher/a306.gif
frame data/chars/players/punisher/a307.gif