Problem spawning npcs

I want to create a battle arena for npcs.

There is 3 waypoints. One for each faction and one for the center of the map.

There is several global variables:
MaxNPCsPerFaction is the max amount of npcs that can exist at once per faction.
Faction1CurSpawnCount = the current amount of npcs spawned for faction 1.
Faction2CurSpawnCount = same as above but for faction 2.

When the module starts, a heartbeat script inside a invisible object is supposed to to check if the current amount of npcs for a faction is below the amount in MaxNPCsPerFaction. If yes it will proceed to spawn npcs for that faction on its waypoint.

When a npc from that faction spawns, he will have a onspawn script that increases the CurSpawnCount of his faction by 1. He will also go to the center of the map running, engaging any enemies he encounters along the way.

when the npc dies, he will decrease the CurSpawnCount of his faction by 1.

So what is the problem? Nothing spawns. The triggers are working correctly (i used debug notifications to make sure).

Here`s the module: NPCBattleArena

You noted the Bluepint ID in CreateObject wrong. It needs to be “orca001” and not the tag…

:man_facepalming: it has been a while since i touched nwn scripting. That worked. Thanks.