This component makes your prefab simple medicine to restore health.
Component Healer Methods
Name | Parameter | Returns | Description |
---|---|---|---|
SetHealthAmount | health | nil | how much it heals for |
Heal | target | true or nil | heals the target if possible and removes the item |
Example
1 2 3 4 5 6 7 8 |
local function fn() local inst = CreateEntity() [...] inst:AddComponent("healer") inst.components.healer:SetHealthAmount(TUNING.HEALING_MEDLARGE) return inst end |