Health
Stores health, damage, regeneration, and death state independently of movement.
- Creatable
Instance.new("Health")- Inherits
- Instance
- Replication
- Standard
Behavior
Health stores health, damage, regeneration, and death state independently of movement.
Summary
Whether character joints are broken when health enters the dead state.
Whether this Health component is in its dead state.
The delay before destruction after death, in seconds.
Whether the owning character or instance is destroyed after death.
Whether ordinary damage is ignored.
The maximum health value.
The health restored per second during regeneration.
The delay after damage before regeneration resumes, in seconds.
The current health value.
Returns this instance if it is an ExecutionGroup.
Restores the requested amount of health up to MaxValue.
Sets the health state to dead.
Restores the Health component from its dead state.
Applies damage through the Health component's protection and death rules.
Fires when damage reduces health.
Fires when health enters the dead state.
Fires when healing increases health.
Properties
BreakJointsOnDeath
Health.BreakJointsOnDeath: boolean = falseWhether character joints are broken when health enters the dead state.
Dead
Health.Dead: boolean = falseWhether this Health component is in its dead state.
DestroyDelay
Health.DestroyDelay: number = 0The delay before destruction after death, in seconds.
DestroyOnDeath
Health.DestroyOnDeath: boolean = falseWhether the owning character or instance is destroyed after death.
Invulnerable
Health.Invulnerable: boolean = falseWhether ordinary damage is ignored.
MaxValue
Health.MaxValue: number = 100The maximum health value.
Regeneration
Health.Regeneration: number = 0The health restored per second during regeneration.
RegenerationDelay
Health.RegenerationDelay: number = 0The delay after damage before regeneration resumes, in seconds.
Value
Health.Value: number = 100The current health value.
Methods
GetExecutionGroup
Health:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
Heal
Health:Heal(amount: number): numberRestores the requested amount of health up to MaxValue.
Kill
Health:Kill(): ()Sets the health state to dead.
Revive
Health:Revive(value: number?): ()Restores the Health component from its dead state.
TakeDamage
Health:TakeDamage(amount: number, source: Instance?): numberApplies damage through the Health component's protection and death rules.
Events
Damaged
Health.Damaged: RBXScriptSignalFires when damage reduces health.
Died
Health.Died: RBXScriptSignalFires when health enters the dead state.
Healed
Health.Healed: RBXScriptSignalFires when healing increases health.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying