Not to tricky....script when spawning from another entity?
use performattack script
Or use@script
void self = getlocalvar("self");
int HP = getentityproperty(self,"health");
if ( HP == 10 ){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
}
@end_script
performattack(self, openborconstant("ANI_FOLLOW1")); }
spawn Galsia
@script
void main()
{
void self = getlocalvar("self");
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
}
@end_script
map 1
coords 680 464
at 50
Is there a way to use performattack script when spawning from another entity? Like a door entity for example.
@mtrain:Here's how to do it:
Bloodbane said:Oh if you want to spawn enemy walking out of door, you shouldn't use such function. You simply need to spawn door opening animation and enemy walking out of door at same time.
Doing this is more efficient, since you can have more enemies walking out of door.
Thank you! Can it be applied to players?
spawn empty
@script
void main()
{
int P1 = getplayerproperty(0, "entity");
int P2 = getplayerproperty(1, "entity");
if(P1){
changeentityproperty(P1, "animation", openborconstant("ANI_FOLLOW1"));
}
if(P2){
changeentityproperty(P2, "animation", openborconstant("ANI_FOLLOW1"));
}
}
@end_script