Skip to content

OnHealingItemUse

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnHealingItemUse( MedicalTool instance, BasePlayer fromPlayer, IMedicalToolTarget toTarget )
{
    Puts( "OnHealingItemUse works!" );
}

Location

  • MedicalTool::GiveEffectsTo(BasePlayer fromPlayer, IMedicalToolTarget toTarget)
csharp
//---
	if (component == null)
	{
		Debug.LogWarning("No consumable for medicaltool: " + base.name);
		return;
	}
	if (Interface.CallHook("OnHealingItemUse", this, fromPlayer, toTarget) != null)
	{
		return;
	}
	Facepunch.Rust.Analytics.Azure.OnMedUsed(ownerItemDefinition.shortname, fromPlayer, toTarget.GetEntity());
	toTarget.OnMedicalToolApplied(fromPlayer, ownerItemDefinition, component, this, this.canRevive);
//---

Released under the MIT License.