SetItemHealthPercent - ObjectReference

SKSE Member of: ObjectReference Script

This Function will set a ObjectReference's health (tempering state) to the specified amount. Works on weapons and armours, including clothes and rings.

SyntaxEdit

Function SetItemHealthPercent(Float health) native

ParametersEdit

  • health - The amount, as a float you wish to set the Object's health to.

See GetItemHealthPercent - ObjectReference for values to use and what they correspond to.

ExamplesEdit

ObjectReference Property weaponRef Auto
Float currenthealth

Function TemperWeapon(float tempering)
	currenthealth = weaponRef.GetItemHealthPercent()
	weaponref.SetItemHealthPercent(currenthealth +tempering)
EndFunction
  • Do note that this will only work on a weapon/armour that is currently loaded and not in a container.

NotesEdit

  • This function can only be run on items outside of containers, as when they are put into containers member functions cannot be called on them.

See AlsoEdit