Jump to content

NPCs Spawning After Killing Certain Amount of Enemies?


Recommended Posts

Hello guys,

This is probably a really simple script, but I can't find any information of how to do it.

I have a room with four enemy NPCs in it and I want to make it so once all four enemies are killed, a door opens and three more NPCs enter the room. Problem is, I don't know how to set up a script to only spawn the three NPCs after the first four are killed. What's the best way to go about this?

Thanks 

Link to comment

You can use a target_counter to count the number of killed NPCs. Give your NPCs an NPC_target matching the targetname of the target_counter, and configure its count accordingly. Then target it to the NPCs behind the door. You can give them a spawnscript to make them run out the door, and I would recommend putting a trigger_multiple with target and target2 behind the door so it stays open until the NPCs have left, in case they take too long (e.g. due to being pushed by the player).

ooeJack likes this
Link to comment
  • 1 month later...

I quote Wonko.

every NPC killed have an NPC_target key with targetname value of the target counter.

into the target counter, you set

count value, example, count 10

and you link the target_counter to a target_scriptrunner. when the counter will reach 10 (or whatever value you want)  it will run the script file that you will set and that's allow you to do... well, whatever you wanna to happens. 🙂

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...