Nice, I got it working now, thanks for all the help!
Now I just need to fix the loop since I saw it did not worked...
My code is like this:
void OnStart()
{
AddEntityCollideCallback("Player", "monact", "startmonster", false, -1);
AddEntityCollideCallback("Enemy_Grunt", "PNScriptArea", "MonsterFunction2", false, 1);
}
void startmonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy_Grunt", true);
AddTimer("", 1, "MonsterFunction2");
}
void MonsterFunction2(string &in asTimer)
{
for (int i = 1; i <40; i++)
{
AddEnemyPatrolNode("Enemy_Grunt", "PathNodeArea_"+i, 0, "");
}
}
The last pathnode(Pathnode nr. 39) is behind the script box PNScriptArea so he walks through the script box to trigger the loop again but this does not seems to work. Any suggestions?