boinga1 Posted January 18, 2003 Share Posted January 18, 2003 It's me again, sorry if this is the wrong forum. How do I get a script to run when an NPC is killed? I've tried searching for it here but can't find it. Link to comment Share on other sites More sharing options...
lassev Posted January 19, 2003 Share Posted January 19, 2003 Well, the most straight-forward way is to set the NPC a death_script. You can do that, for example, in his spawnscript, when you are giving him other attributes. I must confess, no matter how much editing I might have done, that I cannot say, if you can set the death_script straight to the NPC in Radiant, as you can the spawnscript. The other way is, I believe, just to target the NPC to a target_scriptrunner. That should trigger the scriptrunner the moment the NPC is bored of living. Link to comment Share on other sites More sharing options...
Dragarius Posted January 20, 2003 Share Posted January 20, 2003 There are examples of this in the kejim_post map kindly supplied with Radiant. When the stormtroopers outside the front door are killed, they trigger a counter which fires after a certain number have died. The NPC has a key of NPC_target with a value of st_death. The target_counter entity has a targetname of st_death. I would think any entity with the matching targetname would fire. Check it out, I think it will help you. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.