Lua GetHealthPct

From ArcEmu-Wiki
Jump to: navigation, search

Description

This method is used to find the health percentage of the unit when the method is called. Will return a numeric value and can be used on both units and players.

Usage

Unit:GetHealthPct()
player:GetHealthPct()

Example

function NPCScript(Unit)
    if Unit:GetHealthPct() >= 50 then
        Unit:CastSpellOnTarget(5)
    end
end
Personal tools