gob2 Posted May 16, 2018 Share Posted May 16, 2018 I'm trying to make a general script that, when triggered, subtracts a certain amount of HP from the npc, adds a piece of armor from a custom leveled list to the npc, and then makes them equip the armor piece just added. I'm not sure how to go about this. May I have some help please? Link to comment Share on other sites More sharing options...
Evangela Posted May 16, 2018 Share Posted May 16, 2018 (edited) Exactly how do you want the script to trigger? OnDeath, OnTriggerEnter, OnTriggerLeave, OnActivate, OnDying, OnLoad, OnCellAttach, etc.. or in the case of the specific actor, a referencealias script. Edited May 16, 2018 by Rasikko Link to comment Share on other sites More sharing options...
gob2 Posted May 16, 2018 Author Share Posted May 16, 2018 On 5/16/2018 at 6:51 PM, Rasikko said: Exactly how do you want the script to trigger? OnDeath, OnTriggerEnter, OnTriggerLeave, OnActivate, OnDying, OnLoad, OnCellAttach, etc.. or in the case of the specific actor, a referencealias script. Spacefiddle's Scarcity mod uses a script that checks if a power armor piece is at zero HP, and then destroys the piece in question if it is. I've gotten permission to use some of the script so long as I give proper credit. As I understand it, it's an ObjectReference script attached to the power armor piece that fires from an OnHit Event. So when the piece is destroyed the idea is that it would also 1) Subtract a chunk of HP from the owner npc's health pool, NOT the armor's health pool, if that makes sense and 2) Add a piece of armor from a leveled list to the npc and 3) have the npc equip that new piece. Link to comment Share on other sites More sharing options...
Carreau Posted May 17, 2018 Share Posted May 17, 2018 Look up DamageValue() on the ck wiki. Itâs the best way to damage health, ap, and add rads. Link to comment Share on other sites More sharing options...
Recommended Posts