08-01-2013, 01:00 PM
I'm trying to make a script to make an enemy randomly appear and disappear, then loop the script. The problem is, after he has been activated once, he never comes back. Here is my script at the moment -
void OnEnter()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "activatemonster1", true, 1);
}
void activatemonster1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("manhunter_1", true);
AddTimer("", RandFloat(5.0f, 20.0), "deactivatemonster1");
}
void deactivatemonster1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("manhunter_1", false);
AddTimer("", RandFloat(60.0f, 120.0), "activatemonster1");
}
Would someone be able to tell me why its not repeating itself?
void OnEnter()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "activatemonster1", true, 1);
}
void activatemonster1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("manhunter_1", true);
AddTimer("", RandFloat(5.0f, 20.0), "deactivatemonster1");
}
void deactivatemonster1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("manhunter_1", false);
AddTimer("", RandFloat(60.0f, 120.0), "activatemonster1");
}
Would someone be able to tell me why its not repeating itself?