Jump to content

Recommended Posts

Posted

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?

Posted (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 by Rasikko
Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...