PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

HealthChanged

This event fires when the Humanoid/Health changes. However, it will not fire if the health is increasing from a value equal to or greater than the Humanoid/MaxHealth.

When Humanoid/Health reaches zero, the Humanoid will die and the Humanoid/Died event will fire. This event will fire with a value of zero.

Parameters

Name Type Default Description

The new value of Humanoid/Health


Code Samples


Humanoid.HealthChanged

The following example determines the change in health, printing it to the output. It will only work in a LocalScript.


Health Bar

This code sample allows you to create a simple color-changing health bar using two nested Frames. Paste this into a LocalScript on the inner frame.