aL BeasTie
Well-known member
It seems I get worse at scripting rather than better 
This is what I'm trying to do -
I'm trying to make an enemy that spawns and stays motionless until player approaches it (gets within range)
So the idea is too give the enemy a SPAWN anim that is looped so they don't move,
then @script or animationscript in this animation to check if player is in range then change to ANI_FOLLOW2
This is my basic script but, I've tried numerous ways but this is basically what I have.
Obviously this is very wrong...
Can someone please show me the proper way to do this?
This is what I'm trying to do -
I'm trying to make an enemy that spawns and stays motionless until player approaches it (gets within range)
So the idea is too give the enemy a SPAWN anim that is looped so they don't move,
then @script or animationscript in this animation to check if player is in range then change to ANI_FOLLOW2
This is my basic script but, I've tried numerous ways but this is basically what I have.
Code:
void alert()
{
void self = getlocalvar("self");
int player = getlocalvar("player");
int anim = getentityproperty(self, "animationid");
if(checkrange(self, player))
{
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"), 1);
}
}
Obviously this is very wrong...
Can someone please show me the proper way to do this?