Coco Cala Posted June 18, 2021 Posted June 18, 2021 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
mrwonko Posted June 18, 2021 Posted June 18, 2021 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
Coco Cala Posted June 18, 2021 Author Posted June 18, 2021 Perfect, thank you! I figured it was something fairly simple, but just couldn't figure it out. Asgarath83 likes this
Asgarath83 Posted August 18, 2021 Posted August 18, 2021 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now